/* 数字实训平台 · 课程中心 */

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-14);
  line-height: var(--lh-14);
  font-weight: var(--font-weight-regular);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text-primary);
  background: var(--bg-white);
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

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

.app svg {
  display: block;
  width: 100%;
  height: 100%;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-white);
}

/* —— 顶栏 —— */
.topbar {
  height: var(--top-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand__logo {
  width: 182px;
  height: 44px;
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
}

.brand__badge {
  width: 56px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.topbar__tools {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.tool-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.tool-btn--link {
  color: var(--color-primary);
}

.tool-btn__icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user__avatar {
  width: 32px;
  height: 32px;
  border-radius: 42px;
  background: rgba(0, 106, 255, 0.102);
  display: flex;
  align-items: center;
  justify-content: center;
}

.user__avatar-icon {
  width: 17px;
  height: 18px;
  display: flex;
}

.user__name {
  color: var(--text-secondary);
}

/* —— 主体 —— */
.shell {
  flex: 1;
  display: flex;
  min-height: 0;
  background: var(--bg-page);
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-white);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.sidebar__deco {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 200px;
  height: 416px;
  object-fit: cover;
  transform: rotate(180deg);
  pointer-events: none;
}

.sidebar__nav {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 176px;
  height: 54px;
  padding: 0 16px;
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
}

.nav-item__main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-item__icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(76, 155, 253, 0.1);
}

.nav-item__icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item__icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.nav-item__caret {
  width: 12px;
  height: 12px;
  display: flex;
}

.nav-item--practice .nav-item__icon-wrap {
  background: rgba(251, 164, 9, 0.2);
}

.nav-item--exam .nav-item__icon-wrap {
  background: rgba(241, 116, 116, 0.1);
}

.nav-item--resource .nav-item__icon-wrap {
  background: rgba(141, 104, 239, 0.1);
}

.nav-item--ai .nav-item__icon-wrap {
  background: linear-gradient(180deg, #e6f2ff 0%, #efe4ff 100%);
}

.nav-item--manage .nav-item__icon-wrap {
  background: rgba(40, 178, 139, 0.1);
}

.nav-item.is-active {
  background: linear-gradient(79deg, #1677ff 1%, #009eff 98%);
  color: var(--text-on-primary);
}

.nav-item.is-active .nav-item__icon-wrap {
  background: rgba(255, 255, 255, 0.1);
}

.nav-item.is-active .nav-item__icon img:not([data-icon-active]) {
  filter: brightness(0) invert(1);
}

.nav-item.is-active .nav-item__caret path {
  fill: #ffffff;
}

.sidebar__foot {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 12px;
}

.foot-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
}

.foot-item.is-active {
  background: linear-gradient(79deg, #1677ff 1%, #009eff 98%);
  color: var(--text-on-primary);
}

.foot-item__icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.foot-item__icon img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.search-hero {
  position: relative;
  height: 210px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 33px 0 50px;
  gap: 16px;
  background: var(--bg-search);
  overflow: visible;
}

.search-hero__deco-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.search-hero__deco {
  position: absolute;
  pointer-events: none;
}

.search-hero__deco--a {
  width: 144px;
  height: 144px;
  left: 21%;
  top: -75%;
  border-radius: 40px;
  background: #f0f6ff;
  transform: rotate(45deg);
}

.search-hero__deco--b {
  width: 178px;
  height: 178px;
  left: 28%;
  top: 65%;
  border-radius: var(--radius-pill);
  background: #d9e9ff;
}

.search-hero__deco--c {
  width: 178px;
  height: 178px;
  right: 10%;
  top: 76%;
  border-radius: 20px;
  background: #ffeff9;
  transform: rotate(-17.4deg);
}

.search-hero__deco--d {
  width: 178px;
  height: 178px;
  right: -2%;
  top: -68%;
  border-radius: var(--radius-pill);
  background: #e8ebf7;
  transform: rotate(-17.4deg);
}

.search-box {
  position: relative;
  z-index: 1;
  width: min(600px, 92%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.search-box__field {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 4px 24px;
  background: var(--bg-white);
  border-radius: var(--radius-pill);
}

.search-box__input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font-size: var(--font-16);
  line-height: var(--lh-16);
  color: var(--text-primary);
}

.search-box__input::placeholder {
  color: var(--text-muted);
}

.search-box__submit {
  width: 80px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-box__submit-icon {
  width: 24px;
  height: 24px;
  display: flex;
}

.search-box__hints {
  display: flex;
  gap: 24px;
  color: var(--color-primary);
}

.search-box__hint {
  color: var(--color-primary);
}

.filters {
  position: relative;
  z-index: 1;
  background: var(--bg-white);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.filters__rows {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 0;
}

.filter-row__label {
  width: 84px;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.filter-row__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  height: 30px;
  padding: 4px 12px;
  border-radius: 30px;
  color: var(--text-dark);
}

.filter-chip.is-active {
  background: var(--bg-base);
  color: var(--color-primary);
}

.filters__aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  flex-shrink: 0;
}

.purchased {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  cursor: pointer;
}

.purchased input {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  border: 1px solid var(--border-base);
}

.expand-btn {
  height: 34px;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-grey-3);
  color: var(--text-dark);
}

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

.course-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  outline: none;
  transition: box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.course-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.course-card:focus-visible {
  box-shadow: 0 0 0 2px var(--color-primary);
}

.course-card.is-pressed {
  transform: scale(0.99);
}

.course-card__cover {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  aspect-ratio: 376 / 211.5;
  overflow: hidden;
  background: var(--bg-base);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.course-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.course-card__cover-title,
.course-card__badge,
.course-card__sim,
.lesson-btn {
  display: none;
}

.course-card__body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  gap: 16px;
  padding: 16px 16px 24px;
}

.course-card__meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 64px;
}

.course-card__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
}

.course-card__title {
  margin: 0;
  font-size: var(--font-18);
  line-height: var(--lh-18);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-card__majors {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  font-size: var(--font-14);
  line-height: var(--lh-14);
  color: var(--text-secondary);
}

.course-card__majors span {
  padding: 4px 0;
}

.course-card__majors span + span::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 12px;
  margin-right: 8px;
  background: var(--border-grey-5);
  vertical-align: middle;
}

.course-card__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 32px;
}

.course-card__price {
  font-size: var(--font-20);
  line-height: var(--lh-20);
  font-weight: var(--font-weight-medium);
  color: var(--color-success);
}

.soft-icons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.soft-icons img,
.soft-icons__svg {
  width: 32px;
  height: 32px;
  border-radius: 20px;
  object-fit: cover;
  flex-shrink: 0;
}

.rail {
  width: var(--rail-w);
  flex-shrink: 0;
  background: var(--bg-white);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0;
}

.assistant {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 76px;
}

.assistant__img {
  display: block;
  width: 76px;
  height: auto;
  object-fit: contain;
}

.rail__divider {
  width: 50px;
  height: 1px;
  margin: 16px 0;
  background: linear-gradient(270deg, rgba(228, 231, 237, 0) 0%, #e4e7ed 51%, rgba(228, 231, 237, 0) 100%);
}

.tool-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tool-item {
  width: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--text-primary);
}

.tool-item__icon {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-item__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tool-item__icon-svg {
  width: 40px;
  height: 40px;
  display: flex;
}

.tool-item__name {
  font-size: var(--font-12);
  line-height: var(--lh-12);
  text-align: center;
}

.download {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--text-primary);
}

.download__icon {
  position: relative;
  width: 60px;
  height: 60px;
}

.download__bar {
  position: absolute;
  left: 10px;
  top: 12px;
  width: 40px;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(180deg, #c147fc 0%, #1b3eed 100%);
}

.download__shape {
  position: absolute;
  left: 7px;
  top: 14px;
  width: 46px;
  height: 39px;
  display: flex;
}

.download__mark {
  position: absolute;
  left: 20px;
  top: 29px;
  width: 21px;
  height: 19px;
  display: flex;
}

@media (max-width: 1440px) {
  .course-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .rail {
    display: none;
  }

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

@media (max-width: 800px) {
  .sidebar {
    display: none;
  }

  .topbar {
    padding: 0 12px;
  }

  .brand__logo {
    width: 150px;
    height: 36px;
  }

  .topbar__tools {
    display: none;
  }

  .course-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .filters {
    flex-direction: column;
  }
}


.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 176px;
  border-radius: 16px;
}

.nav-group.is-open {
  background: linear-gradient(180deg, #edfffe 0%, #ffffff 100%);
}

.nav-item--course-parent.is-open {
  background: transparent;
  color: var(--text-primary);
}

.nav-item--course-parent.is-open .nav-item__icon-wrap {
  background: rgba(40, 178, 139, 0.1);
}

.nav-item--course-parent.is-open .nav-item__caret {
  transform: rotate(180deg);
}

.nav-item--course-parent.is-open .nav-item__caret path {
  fill: #606266;
}

.nav-item--teach-parent.is-open {
  background: transparent;
  color: var(--text-primary);
}

.nav-item--teach-parent.is-open .nav-item__caret {
  transform: rotate(180deg);
}

.nav-item--teach-parent.is-open .nav-item__caret path {
  fill: #606266;
}

.nav-sub {
  display: none;
  flex-direction: column;
  gap: 4px;
}

.nav-group.is-open .nav-sub {
  display: flex;
}

.nav-sub__item {
  cursor: pointer;
  display: flex;
  align-items: center;
  width: 176px;
  height: 46px;
  padding: 0 24px;
  text-decoration: none;
}

.nav-sub__label {
  display: flex;
  align-items: center;
  width: 128px;
  height: 46px;
  padding-left: 36px;
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: var(--font-14);
  line-height: 20px;
}

.nav-sub__item.is-active .nav-sub__label {
  background: linear-gradient(78deg, #1677ff 1%, #009eff 98%);
  color: var(--text-on-primary);
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hero-copy__title {
  margin: 0;
  font-size: 24px;
  line-height: 32px;
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
}

.hero-copy__desc {
  margin: 0;
  font-size: var(--font-14);
  line-height: 22px;
  color: var(--text-secondary);
}

.hero-tabs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  height: 50px;
  padding: 0 24px;
}

.hero-tab {
  position: relative;
  z-index: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 32px;
  color: var(--text-primary);
  font-size: var(--font-16);
  line-height: 24px;
  font-weight: var(--font-weight-regular);
  background: transparent;
  white-space: nowrap;
}

.hero-tab.is-active {
  z-index: 1;
  height: 50px;
  padding: 11px 32px 15px;
  align-items: flex-start;
  color: var(--color-primary);
  font-weight: var(--font-weight-medium);
  background: none;
}

.hero-tab.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  left: -13px;
  right: -13px;
  height: 50px;
  background: url("../assets/icons/hero-tab-active.svg") no-repeat center / 100% 100%;
  z-index: -1;
  pointer-events: none;
}
