:root {
  --background: #f8fbff;
  --foreground: #162033;
  --card: #ffffff;
  --muted: #eef4fb;
  --muted-foreground: #64748b;
  --primary: #4f6fe8;
  --primary-soft: #eef3ff;
  --accent: #f4f0ff;
  --border: #dce6f2;
  --shadow: 0 18px 42px rgba(79, 111, 232, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(248, 251, 255, 0.88);
  backdrop-filter: blur(14px);
  padding: 10px 0;
}

.topbar-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand,
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  background: var(--primary-soft);
  color: rgba(79, 111, 232, 0.85);
}

.brand-logo {
  display: block;
  width: auto;
  height: 40px;
}

.brand-text {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  color: var(--muted-foreground);
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.nav-links a:hover,
.back-link:hover {
  color: var(--primary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.language-switcher {
  display: flex;
  align-items: center;
}

.language-switcher .trp_language_switcher_shortcode {
  display: flex;
  align-items: center;
}

.language-switcher .trp-language-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
}

.language-switcher .trp-ls-shortcode-current-language a,
.language-switcher .trp-ls-shortcode-language a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--foreground);
  font-weight: 700;
}

.language-switcher .trp-flag-image {
  display: block;
  width: 18px;
  height: 12px;
  border-radius: 2px;
}

.language-switcher--mobile {
  display: none;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid rgba(79, 111, 232, 0.16);
  border-radius: 12px;
  background: #fff;
  color: var(--foreground);
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(27, 53, 94, 0.08);
}

.nav-toggle span {
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.topbar.is-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.topbar.is-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.topbar.is-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.hero {
  background: linear-gradient(135deg, rgba(79, 111, 232, 0.1), rgba(168, 137, 255, 0.1));
}

.hero-inner {
  min-height: 360px;
  display: grid;
  align-items: center;
  text-align: center;
}

.hero-copy {
  max-width: 760px;
  margin: 0 auto;
}

.eyebrow,
.tag,
.chapter,
.member-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.eyebrow {
  padding: 6px 12px;
  font-size: 14px;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 56px);
  letter-spacing: 0;
}

h2,
h3,
p {
  margin-top: 0;
}

.hero p {
  color: var(--muted-foreground);
  font-size: 18px;
  line-height: 1.8;
}

.hero-actions,
.form-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 800;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(180deg, #a97cf4 0%, #7a4fe0 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(122, 79, 224, 0.22);
  border: 1px solid rgba(122, 79, 224, 0.28);
  text-shadow: none;
  transform: none;
  transition: background 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-primary:hover {
  filter: brightness(1.03);
  box-shadow: 0 12px 24px rgba(122, 79, 224, 0.26);
}

.btn-primary:active {
  transform: none;
  box-shadow: 0 8px 18px rgba(122, 79, 224, 0.2);
}

.btn-primary-light {
  border: 1px solid rgba(79, 111, 232, 0.12);
  background: var(--primary-soft);
  color: rgba(79, 111, 232, 0.86);
}

.btn-soft {
  background: var(--muted);
  color: var(--foreground);
}

.search-section {
  margin-top: -34px;
}

.search-panel,
.filter-card,
.course-card,
.profile-card,
.learn-card,
.favorite-card,
.password-card,
.side-card,
.share-box {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.search-panel {
  border-radius: 24px;
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr 180px auto;
  gap: 12px;
}

.search-panel input,
.search-panel select,
.search-box,
.password-card input,
.copy-row input {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  padding: 12px 14px;
  outline: none;
}

.search-panel select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position:
    calc(100% - 26px) 50%,
    calc(100% - 20px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.section,
.page-main {
  padding: 44px 0;
}

.stats-section {
  padding-top: 38px;
}

.stats-grid,
.service-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.stat-card,
.service-card {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 24px;
}

.stat-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 32px;
  line-height: 1;
}

.stat-card span,
.service-card span {
  color: var(--muted-foreground);
}

.service-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  margin-bottom: 24px;
}

.section-title h2,
.page-heading h1 {
  font-size: 30px;
  color: var(--primary);
}

.section-title p {
  color: var(--muted-foreground);
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.course-grid.four-cols {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.course-card,
.favorite-card,
.learn-card,
.password-card {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.course-card:hover,
.favorite-card:hover,
.learn-card:hover {
  transform: translateY(-4px);
}

.course-cover,
.blue-cover {
  min-height: 190px;
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.65), transparent 24%),
    linear-gradient(135deg, rgba(79, 111, 232, 0.14), rgba(168, 137, 255, 0.18));
  position: relative;
}

.course-cover.has-thumbnail {
  min-height: 190px;
}

.course-cover.has-thumbnail::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 66px;
  height: 66px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.98) 0 12%, rgba(235, 241, 249, 0.92) 25%, rgba(154, 171, 196, 0.88) 64%, rgba(88, 112, 147, 0.92) 100%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(109, 132, 166, 0.88));
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.9),
    inset 0 -7px 12px rgba(33, 48, 74, 0.32),
    0 18px 34px rgba(15, 23, 42, 0.28),
    0 3px 0 rgba(58, 74, 103, 0.42);
  backdrop-filter: blur(7px) saturate(1.2);
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.course-cover.has-thumbnail::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 20px solid rgba(50, 86, 190, 0.96);
  filter: drop-shadow(0 2px 1px rgba(255, 255, 255, 0.38)) drop-shadow(0 4px 5px rgba(18, 36, 86, 0.34));
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease;
}

.course-card:hover .course-cover.has-thumbnail::before {
  background:
    radial-gradient(circle at 32% 24%, #fff 0 14%, rgba(243, 247, 253, 0.96) 28%, rgba(166, 187, 218, 0.92) 66%, rgba(71, 96, 142, 0.94) 100%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(103, 128, 170, 0.9));
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.95),
    inset 0 -7px 13px rgba(28, 45, 78, 0.36),
    0 22px 42px rgba(15, 23, 42, 0.32),
    0 4px 0 rgba(55, 73, 108, 0.48);
  transform: translate(-50%, -50%) scale(1.06);
}

.course-card:hover .course-cover.has-thumbnail::after {
  transform: translate(-50%, -50%) scale(1.08);
}

.course-cover-image {
  display: block;
  height: 190px;
  object-fit: cover;
  width: 100%;
}

.blue-cover::after {
  content: "CSCAI";
  position: absolute;
  inset: 24px 28px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  color: rgba(17, 76, 132, 0.82);
  font-size: 38px;
  font-weight: 900;
}

.blue-cover.has-thumbnail::after {
  content: none;
}

.course-body {
  padding: 20px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 12px;
}

.course-body h3 {
  font-size: 18px;
  line-height: 1.45;
  margin: 0;
  grid-column: 2;
  grid-row: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.free-tag {
  position: absolute;
  left: 20px;
  top: 20px;
  border-radius: 999px;
  background: #e9fbf2;
  color: #25a86a;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 800;
}

.tag {
  padding: 5px 12px;
  font-size: 13px;
}

.tag-orange {
  background: #fff0d8;
  color: #9b5a00;
}

.tag-pink {
  background: #fde9f5;
  color: #b63d83;
}

.tag-blue {
  background: #dcecff;
  color: #2e6ee8;
}

.tag-purple {
  background: #efe1ff;
  color: #7950d8;
}

.tag-green {
  background: #d9f8e7;
  color: #168354;
}

.course-body > .tag {
  margin-left: 0;
  grid-column: 1;
  grid-row: 1;
}

.tag.muted {
  background: var(--muted);
  color: var(--muted-foreground);
}

.course-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted-foreground);
}

.badge-round,
.num {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: rgba(79, 111, 232, 0.86);
  font-weight: 900;
}

.muted-band,
.sort-bar {
  background: rgba(238, 244, 251, 0.5);
}

.category-grid,
.category-layout {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.category-card {
  display: flex;
  align-items: center;
  gap: 16px;
  grid-column: span 2;
  border-radius: 20px;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--border);
  font-weight: 800;
  box-shadow: var(--shadow);
}

.category-card.large {
  grid-column: span 3;
}

.category-card h3 {
  margin: 0 0 6px;
}

.category-card p {
  margin: 0;
  color: var(--muted-foreground);
  line-height: 1.7;
}

.category-icon {
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 900;
}

.home-category-layout {
  grid-template-columns: repeat(6, 1fr);
  gap: 24px;
}

.home-category-card {
  position: relative;
  min-height: 134px;
  border-radius: 24px;
  border-color: #d9e4f2;
  padding: 32px 58px 32px 32px;
  box-shadow: none;
}

.home-category-card.large {
  min-height: 176px;
}

.home-category-card .category-icon {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  position: relative;
}

.home-category-card .category-icon::after {
  content: "";
  width: 36px;
  height: 36px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.34);
}

.home-category-card h3 {
  margin: 0;
  color: #07142b;
  font-size: 19px;
  font-weight: 900;
}

.home-category-card.large h3 {
  font-size: 21px;
}

.home-category-card p {
  margin-top: 10px;
  color: #53657e;
  font-size: 14px;
  line-height: 1.6;
}

.category-arrow {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 44px;
  font-style: normal;
  font-weight: 300;
  line-height: 1;
}

.tone-orange .category-icon {
  background: #fff0d8;
}

.tone-pink .category-icon {
  background: #fde9f5;
}

.tone-blue .category-icon {
  background: #dcecff;
}

.tone-purple .category-icon {
  background: #efe1ff;
}

.tone-green .category-icon {
  background: #d9f8e7;
}

.filter-card {
  border-radius: 28px;
  padding: 28px;
}

.filter-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.filter-head h1 {
  margin-top: 10px;
  font-size: 32px;
  line-height: 1.05;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(360px, 100%);
}

.search-trigger,
.search-clear {
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  flex: 0 0 auto;
}

.search-trigger {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.search-trigger:hover,
.search-clear:hover {
  color: rgba(79, 111, 232, 0.92);
}

.search-clear {
  border-left: 1px solid var(--border);
  padding-left: 10px;
  font-size: 13px;
  font-weight: 800;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.filter-row > span {
  width: 54px;
  color: var(--muted-foreground);
}

.chip {
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
}

.chip.active {
  background: var(--primary-soft);
  color: rgba(79, 111, 232, 0.86);
  font-weight: 800;
}

.sort-bar {
  margin: 24px 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  color: var(--muted-foreground);
}

.course-pagination {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 46px auto 34px;
  padding: 18px 0 12px;
  text-align: center;
}

.course-pagination > button {
  appearance: none;
  min-width: 44px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(27, 53, 94, 0.08);
  color: #53657e;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  line-height: 42px;
  text-align: center;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.course-pagination > button:hover:not(:disabled) {
  border-color: rgba(79, 111, 232, 0.32);
  background: #f6f8ff;
  color: rgba(79, 111, 232, 0.92);
  transform: translateY(-1px);
}

.course-pagination > button.active {
  border-color: rgba(79, 111, 232, 0.28);
  background: rgba(79, 111, 232, 0.94);
  box-shadow: 0 12px 26px rgba(79, 111, 232, 0.22);
  color: #fff;
}

.course-pagination > button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.course-pagination > button.active:disabled {
  opacity: 1;
}

.detail-layout,
.member-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
}

.member-layout {
  grid-template-columns: 320px 1fr;
}

.video-box {
  aspect-ratio: 16 / 9;
  border-radius: 28px;
  overflow: hidden;
  display: grid;
  place-items: center;
  text-align: center;
  background: linear-gradient(135deg, rgba(79, 111, 232, 0.08), rgba(168, 137, 255, 0.12));
  box-shadow: var(--shadow);
  padding: 18px;
}

.video-box iframe {
  width: 100%;
  height: 100%;
  max-width: 920px;
  border: 0;
  border-radius: 18px;
}

.play-large {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 28px;
}

.detail-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 24px 0 18px;
}

.detail-title h1 {
  font-size: clamp(28px, 3vw, 32px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 760px;
  word-break: break-word;
}

.detail-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.favorite-toggle {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(79, 111, 232, 0.16);
  border-radius: 999px;
  background: #fff;
  color: var(--muted-foreground);
  padding: 8px 14px;
  font-weight: 800;
  cursor: pointer;
}

.favorite-toggle:hover,
.favorite-toggle.is-favorited {
  color: rgba(79, 111, 232, 0.96);
  background: var(--primary-soft);
}

.favorite-toggle:disabled {
  cursor: wait;
  opacity: 0.7;
}

.favorite-icon {
  font-size: 18px;
  line-height: 1;
}

.copy-row {
  display: flex;
  gap: 10px;
}

.copy-row input {
  flex: 1;
}

.share-buttons {
  margin-top: 16px;
}

.tabs {
  border-bottom: 1px solid var(--border);
  margin-top: 26px;
}

.tabs button {
  border: 0;
  background: transparent;
  padding: 14px 0;
  margin-right: 24px;
  color: var(--muted-foreground);
}

.tabs .active {
  border-bottom: 3px solid var(--primary);
  color: var(--primary);
  font-weight: 800;
}

.detail-text {
  margin-top: 20px;
  color: var(--muted-foreground);
  line-height: 1.9;
}

.detail-side {
  display: grid;
  gap: 18px;
  align-content: start;
}

.side-card,
.share-box {
  border-radius: 22px;
  padding: 22px;
}

.side-card a {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.side-card a span {
  position: relative;
  color: transparent;
  width: 18px;
  flex: 0 0 18px;
}

.side-card a span::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid rgba(79, 111, 232, 0.75);
  transform: translateY(-50%);
}

.side-card a.curr {
  position: relative;
  margin: 8px -10px 0;
  border-top-color: transparent;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(79, 111, 232, 0.14), rgba(168, 137, 255, 0.12));
  box-shadow: inset 3px 0 0 rgba(79, 111, 232, 0.9);
  color: rgba(28, 63, 140, 0.96);
  font-weight: 800;
  padding: 14px 14px 14px 18px;
}

.side-card a.curr + a {
  border-top-color: transparent;
}

.side-card a.curr span {
  color: rgba(79, 111, 232, 0.96);
}

.teacher {
  display: flex;
  gap: 14px;
  align-items: center;
}

.avatar-mini {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 900;
}

.profile-card {
  border-radius: 28px;
  overflow: hidden;
  align-self: start;
}

.profile-banner {
  height: 132px;
  background:
    radial-gradient(circle at 92% 0%, rgba(255, 255, 255, 0.65), transparent 28%),
    linear-gradient(135deg, rgba(79, 111, 232, 0.16), rgba(168, 137, 255, 0.18));
}

.profile-content {
  margin-top: -62px;
  padding: 0 28px 28px;
  text-align: center;
}

.avatar-art {
  width: 128px;
  height: 128px;
  margin: 0 auto;
  border: 4px solid #fff;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 64%, #111 0 28%, transparent 29%),
    radial-gradient(circle at 50% 44%, #ffefc4 0 28%, transparent 29%),
    linear-gradient(135deg, rgba(79, 111, 232, 0.12), rgba(168, 137, 255, 0.18));
  box-shadow: 0 12px 24px rgba(79, 111, 232, 0.1);
}

.member-pill {
  padding: 8px 18px;
  font-size: 14px;
}

.profile-line {
  height: 1px;
  margin: 28px 0;
  background: linear-gradient(90deg, transparent, rgba(79, 111, 232, 0.18), transparent);
}

.profile-nav {
  display: grid;
  gap: 12px;
}

.profile-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 18px;
  padding: 16px 18px;
  background: rgba(238, 244, 251, 0.55);
  color: var(--foreground);
  font-weight: 800;
}

.profile-nav a.active {
  border: 1px solid rgba(79, 111, 232, 0.14);
  background: var(--primary-soft);
  color: rgba(79, 111, 232, 0.86);
}

.profile-nav span {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-heading {
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.page-heading h1 {
  display: inline-block;
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 4px solid var(--primary);
}

.stack {
  display: grid;
  gap: 24px;
}

.learn-card {
  padding: 26px;
}

.learn-remove {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.learn-remove:hover {
  background: #fee2e2;
  color: #dc2626;
}

.learn-remove:disabled {
  cursor: wait;
  opacity: 0.7;
}

.learn-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.learn-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.learn-head > div {
  display: flex;
  gap: 16px;
  align-items: center;
}

.chapter {
  padding: 10px 18px;
}

.learn-body {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  gap: 24px;
  align-items: center;
  border-radius: 26px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(79, 111, 232, 0.05), rgba(168, 137, 255, 0.08));
}

.lesson-cover,
.favorite-cover {
  min-height: 190px;
  border-radius: 22px;
  padding: 28px;
  color: rgba(79, 111, 232, 0.86);
  background:
    radial-gradient(circle at 85% 22%, rgba(255, 255, 255, 0.65), transparent 28%),
    linear-gradient(135deg, rgba(79, 111, 232, 0.12), rgba(168, 137, 255, 0.16));
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(79, 111, 232, 0.08);
}

.lesson-cover strong,
.favorite-cover strong {
  display: block;
  margin-top: 26px;
  color: var(--foreground);
}

.lesson-cover small {
  display: inline-flex;
  margin-top: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  color: rgba(79, 111, 232, 0.86);
}

.lesson-cover img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.qr-cover {
  display: grid;
  place-items: center;
  color: #111;
  letter-spacing: 6px;
  text-align: center;
}

.learn-info h3 {
  font-size: 22px;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted-foreground);
  font-weight: 800;
}

.progress {
  height: 12px;
  margin: 12px 0 24px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(238, 244, 251, 0.9);
}

.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(79, 111, 232, 0.38), rgba(168, 137, 255, 0.38));
}

.favorite-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.favorite-card {
  padding: 20px;
}

.favorite-cover {
  position: relative;
}

.favorite-cover img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.favorite-cover span,
.favorite-remove {
  position: absolute;
  right: 22px;
  bottom: 20px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--primary-soft);
}

.favorite-remove {
  border: 0;
  color: #ffb800;
  font-size: 22px;
  cursor: pointer;
}

.favorite-remove:hover {
  background: #fff4c7;
}

.favorite-remove:disabled {
  cursor: wait;
  opacity: 0.7;
}

.state-card {
  grid-column: 1 / -1;
  border: 1px dashed var(--border);
  border-radius: 18px;
  background: var(--card);
  padding: 34px;
  color: var(--muted-foreground);
  font-weight: 800;
  text-align: center;
}

.password-card {
  padding: 0;
  overflow: hidden;
}

.password-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 30px;
  background: linear-gradient(135deg, rgba(79, 111, 232, 0.06), rgba(168, 137, 255, 0.08));
}

.password-head span {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--primary-soft);
  color: rgba(79, 111, 232, 0.86);
  font-weight: 900;
}

.password-card label {
  display: grid;
  gap: 10px;
  margin: 22px 30px;
  font-weight: 800;
}

.password-card input {
  width: 100%;
}

.password-card .form-actions {
  justify-content: flex-start;
  margin: 26px 30px 30px;
}

.form-message {
  min-height: 22px;
  margin: 0 30px;
  color: var(--muted-foreground);
  font-weight: 700;
}

.form-message.success {
  color: #15803d;
}

.form-message.error {
  color: #dc2626;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--muted-foreground);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
}

@media (max-width: 900px) {
  .topbar-inner {
    position: relative;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 1px);
    display: grid;
    gap: 0;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(248, 251, 255, 0.98);
    box-shadow: 0 18px 42px rgba(79, 111, 232, 0.08);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 30;
  }

  .topbar.is-open .nav-links {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-links a {
    width: 100%;
    padding: 14px 4px;
    border-top: 1px solid var(--border);
  }

  .nav-links a:first-child {
    border-top: 0;
  }

  .search-panel,
  .detail-layout,
  .member-layout,
  .learn-body,
  .course-grid,
  .course-grid.four-cols,
  .stats-grid,
  .service-grid,
  .favorite-grid {
    grid-template-columns: 1fr;
  }

  .filter-head,
  .sort-bar,
  .section-title,
  .learn-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .category-grid,
  .category-layout {
    grid-template-columns: 1fr;
  }

  .category-card,
  .category-card.large {
    grid-column: auto;
  }

  .profile-card {
    position: static;
  }

  .footer-inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}
