/* ==========================================================
   components.css · 公共组件
   ========================================================== */

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 28px;
  border-radius: var(--r-md);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--dur) var(--ease);
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-2px); }

.btn--primary {
  background: var(--c-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(30, 120, 235, .28);
}
.btn--primary:hover {
  background: var(--c-primary-dark);
  color: #fff;
  box-shadow: 0 10px 24px rgba(30, 120, 235, .38);
}

.btn--gradient {
  background: var(--c-gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(30, 120, 235, .28);
}
.btn--gradient:hover { color: #fff; box-shadow: 0 10px 26px rgba(30, 120, 235, .4); }

.btn--outline {
  background: #fff;
  color: var(--c-primary);
  border-color: var(--c-primary);
}
.btn--outline:hover { background: var(--c-primary); color: #fff; }

.btn--ghost-light {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, .6);
}
.btn--ghost-light:hover { background: #fff; color: var(--c-primary); }

.btn--white { background: #fff; color: var(--c-primary); }
.btn--white:hover { background: #f0f6ff; color: var(--c-primary-dark); }

.btn--sm { height: 36px; padding: 0 16px; font-size: 14px; border-radius: var(--r-sm); }
.btn--lg { height: 56px; padding: 0 40px; font-size: 18px; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .65; pointer-events: none; }

.btn__spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.btn.is-loading .btn__spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 文字链接 */
.link-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--c-primary);
  font-size: 15px;
  font-weight: 600;
}
.link-more .arrow { transition: transform var(--dur) var(--ease); }
.link-more:hover .arrow { transform: translateX(5px); }

/* ---------------- 标签 ---------------- */
.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  background: var(--c-primary-light);
  color: var(--c-primary);
  white-space: nowrap;
}
.tag--solid { background: var(--c-primary); color: #fff; }
.tag--orange { background: #fff3e8; color: var(--c-orange); }
.tag--green { background: #e8f8ee; color: var(--c-green); }
.tag--gray { background: #f1f5f9; color: var(--t-sub); }
.tag--dark { background: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .9); }
.tag--lg { height: 30px; padding: 0 14px; font-size: 13px; }

/* ---------------- 卡片 ---------------- */
.card {
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  overflow: hidden;
  transition: all var(--dur-slow) var(--ease);
  position: relative;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--c-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-slow) var(--ease);
  z-index: 2;
}
.card:hover { transform: translateY(-8px); box-shadow: var(--sh-hover); }
.card:hover::before { transform: scaleX(1); }

/* ---------------- 课程卡片（首页 / 列表页通用） ---------------- */
.course-card {
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  position: relative;
  transition: all var(--dur-slow) var(--ease);
}
.course-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--c-gradient);
  transition: height var(--dur-slow) var(--ease);
}
.course-card:hover { transform: translateY(-8px); box-shadow: var(--sh-hover); }
.course-card:hover::after { height: 6px; }

.course-card__body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.course-card__icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--c-primary-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-primary);
  margin-bottom: 18px;
}
.course-card__icon svg { width: 32px; height: 32px; }
.course-card__title { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.course-card__desc {
  font-size: 14px;
  color: var(--t-sub);
  line-height: 1.7;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-card__foot { margin-top: auto; }

/* 列表页卡片（带封面） */
.course-card--list { min-height: 0; }
.course-card__cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-gray);
}
.course-card__cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease);
}
.course-card:hover .course-card__cover img { transform: scale(1.05); }
.course-card__badge {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 2;
}
.course-card__title--list { font-size: 18px; }
.course-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}
.course-card__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px dashed #e8edf5;
  margin-top: auto;
}
.course-price {
  font-family: var(--font-num);
  font-size: 26px;
  font-weight: 700;
  color: var(--c-orange);
  line-height: 1;
}
.course-price small { font-size: 14px; font-weight: 600; }
.course-price__old {
  font-size: 13px;
  color: var(--t-weak);
  text-decoration: line-through;
  margin-left: 6px;
}

/* ---------------- 统计数字 ---------------- */
.stat-card {
  text-align: center;
  padding: var(--sp-3) var(--sp-2);
  background: #fff;
  border-radius: var(--r-lg);
  transition: all var(--dur-slow) var(--ease);
}
.stat-card:hover { transform: translateY(-6px); box-shadow: var(--sh-card); }
.stat-card__icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--c-primary-light);
  color: var(--c-primary);
  display: flex; align-items: center; justify-content: center;
}
.stat-card__icon svg { width: 28px; height: 28px; }
.stat-card__num {
  font-family: var(--font-num);
  font-size: 48px;
  font-weight: 700;
  color: var(--c-primary);
  line-height: 1.1;
  letter-spacing: -1px;
}
.stat-card__unit { font-size: 24px; font-weight: 700; }
.stat-card__label { font-size: 15px; color: var(--t-sub); margin-top: 6px; }

/* ---------------- 面包屑 ---------------- */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, .75);
}
.breadcrumb a { color: rgba(255, 255, 255, .8); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb__sep { opacity: .5; }
.breadcrumb--dark { color: var(--t-sub); }
.breadcrumb--dark a { color: var(--t-sub); }
.breadcrumb--dark a:hover { color: var(--c-primary); }
.breadcrumb__current { color: #fff; }

/* ---------------- 子页 Banner ---------------- */
.page-banner {
  position: relative;
  min-height: 300px;
  display: flex;
  align-items: center;
  background: var(--c-gradient-cta);
  color: #fff;
  overflow: hidden;
  padding: 40px 0;
}
.page-banner__canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 1;
  opacity: .8;
}
.page-banner__inner { position: relative; z-index: 2; width: 100%; }
.page-banner__title { font-size: 48px; font-weight: 700; color: #fff; margin: 12px 0 10px; }
.page-banner__sub { font-size: 18px; color: rgba(255, 255, 255, .82); }
.page-banner::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 60px;
  background: #fff;
  clip-path: ellipse(75% 100% at 50% 100%);
  z-index: 3;
}
.page-banner--plain::after { display: none; }

/* ---------------- 筛选栏 ---------------- */
.filter-bar {
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .06);
  position: sticky;
  top: var(--header-h);
  z-index: 60;
  padding: 16px 0;
}
.filter-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 8px 0;
}
.filter-row__label {
  flex: none;
  width: 76px;
  font-size: 14px;
  font-weight: 600;
  color: var(--t-sub);
  padding-top: 5px;
}
.filter-row__opts { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  border: 1px solid #e3e9f2;
  background: #fff;
  color: var(--t-sub);
  font-size: 14px;
  transition: all var(--dur) var(--ease);
}
.chip:hover { border-color: var(--c-primary); color: var(--c-primary); }
.chip.is-active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
  font-weight: 600;
}

/* ---------------- Tab 切换 ---------------- */
.tabs-nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #eef1f6;
  position: relative;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-nav::-webkit-scrollbar { display: none; }
.tabs-nav__item {
  flex: none;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 600;
  color: var(--t-sub);
  background: none;
  position: relative;
  transition: color var(--dur) var(--ease);
  white-space: nowrap;
}
.tabs-nav__item::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 0;
  width: 0; height: 3px;
  background: var(--c-primary);
  border-radius: 2px 2px 0 0;
  transform: translateX(-50%);
  transition: width var(--dur) var(--ease);
}
.tabs-nav__item:hover { color: var(--c-primary); }
.tabs-nav__item.is-active { color: var(--c-primary); }
.tabs-nav__item.is-active::after { width: 60%; }
.tabs-panel { display: none; padding-top: 32px; }
.tabs-panel.is-active { display: block; animation: fadeUp .4s var(--ease-out); }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* ---------------- 手风琴 ---------------- */
.accordion { border: 1px solid #eef1f6; border-radius: var(--r-lg); overflow: hidden; background: #fff; }
.accordion__item + .accordion__item { border-top: 1px solid #eef1f6; }
.accordion__head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  background: #fff;
  transition: background var(--dur) var(--ease);
}
.accordion__head:hover { background: var(--c-primary-light); }
.accordion__item.is-open .accordion__head { background: var(--c-primary-light); color: var(--c-primary-dark); }
.accordion__arrow {
  flex: none;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  transition: transform var(--dur) var(--ease);
  color: var(--c-primary);
}
.accordion__item.is-open .accordion__arrow { transform: rotate(180deg); }
.accordion__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s var(--ease), opacity .3s var(--ease);
  opacity: 0;
}
.accordion__item.is-open .accordion__body { opacity: 1; }
.accordion__inner { padding: 4px 24px 22px; color: var(--t-sub); font-size: 15px; }

/* ---------------- 分页 ---------------- */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: var(--sp-5); }
.pagination__btn {
  min-width: 40px; height: 40px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid #e3e9f2;
  background: #fff;
  color: var(--t-sub);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur) var(--ease);
}
.pagination__btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.pagination__btn.is-active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}
.pagination__btn[disabled] { opacity: .45; pointer-events: none; }
.pagination__dots { color: var(--t-weak); }

/* ---------------- 表单 ---------------- */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}
.form-label .req { color: var(--c-orange); margin-left: 2px; }
.form-control {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid #e3e9f2;
  border-radius: var(--r-md);
  background: #fff;
  font-size: 15px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.form-control:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(30, 120, 235, .12);
}
textarea.form-control { height: auto; min-height: 120px; padding: 14px 16px; resize: vertical; line-height: 1.7; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.form-control.is-error { border-color: #ef4444; }
.form-error {
  display: none;
  color: #ef4444;
  font-size: 13px;
  margin-top: 6px;
}
.form-error.is-show { display: block; }
.form-radios { display: flex; flex-wrap: wrap; gap: 12px; }
.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid #e3e9f2;
  border-radius: var(--r-pill);
  cursor: pointer;
  font-size: 15px;
  transition: all var(--dur) var(--ease);
}
.radio-pill input { position: absolute; opacity: 0; pointer-events: none; }
.radio-pill:hover { border-color: var(--c-primary); }
.radio-pill.is-checked { border-color: var(--c-primary); background: var(--c-primary-light); color: var(--c-primary-dark); font-weight: 600; }

/* ---------------- 弹窗 ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.is-open { display: flex; }
.modal__mask { position: absolute; inset: 0; background: rgba(15, 23, 42, .6); backdrop-filter: blur(3px); }
.modal__dialog {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--r-xl);
  padding: 40px 32px;
  text-align: center;
  animation: modalIn .35s var(--ease-out);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to { opacity: 1; transform: none; }
}
.modal__icon {
  width: 72px; height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--c-primary-light);
  color: var(--c-primary);
  display: grid;
  place-items: center;
}
.modal__title { font-size: 22px; margin-bottom: 10px; }
.modal__desc { color: var(--t-sub); font-size: 15px; margin-bottom: 24px; }
.modal__close { position: absolute; top: 14px; right: 16px; font-size: 24px; color: var(--t-weak); line-height: 1; }
.modal__close:hover { color: var(--t-main); }

/* ---------------- 轮播（轻量 Swiper） ---------------- */
.swiper { position: relative; overflow: hidden; }
.swiper__track {
  display: flex;
  transition: transform .5s var(--ease);
  will-change: transform;
}
.swiper__slide { flex: 0 0 100%; min-width: 0; }
.swiper--peek .swiper__slide { padding: 0 8px; }
.swiper__dots { display: flex; justify-content: center; gap: 8px; margin-top: 24px; }
.swiper__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(30, 120, 235, .25);
  transition: all var(--dur) var(--ease);
}
.swiper__dot.is-active { width: 26px; border-radius: 5px; background: var(--c-primary); }
.swiper__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--c-primary);
  display: grid;
  place-items: center;
  box-shadow: var(--sh-card);
  z-index: 5;
  transition: all var(--dur) var(--ease);
}
.swiper__nav:hover { background: var(--c-primary); color: #fff; }
.swiper__nav--prev { left: 16px; }
.swiper__nav--next { right: 16px; }

/* ---------------- Logo 无限滚动 ---------------- */
.marquee { overflow: hidden; width: 100%; }
.marquee__inner { display: flex; width: max-content; animation: marquee 32s linear infinite; }
.marquee--reverse .marquee__inner { animation-direction: reverse; }
.marquee:hover .marquee__inner { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee__item {
  flex: none;
  width: 180px;
  height: 76px;
  margin: 6px;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: var(--r-md);
  filter: grayscale(1);
  opacity: .55;
  transition: all var(--dur) var(--ease);
}
.marquee__item:hover { filter: none; opacity: 1; box-shadow: var(--sh-card); }
.marquee__item img { max-height: 40px; width: auto; }

/* ---------------- 时间轴 ---------------- */
.timeline { position: relative; padding-left: 0; }
.timeline::before {
  content: "";
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--c-primary-light) 8%, var(--c-primary-light) 92%, transparent);
  transform: translateX(-50%);
}
.timeline__item {
  position: relative;
  width: 50%;
  padding: 0 48px 40px 0;
}
.timeline__item:nth-child(even) { margin-left: 50%; padding: 0 0 40px 48px; }
.timeline__item::after {
  content: "";
  position: absolute;
  top: 6px;
  right: -7px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--c-primary);
  box-shadow: 0 0 0 4px var(--c-primary-light);
}
.timeline__item:nth-child(even)::after { right: auto; left: -7px; }
.timeline__year {
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 700;
  color: var(--c-primary);
  margin-bottom: 6px;
}
.timeline__box {
  background: #fff;
  border-radius: var(--r-lg);
  padding: 20px 24px;
  box-shadow: var(--sh-card);
}
.timeline__title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.timeline__desc { font-size: 14px; color: var(--t-sub); }

/* 竖向时间轴（学习路线 / 大事记） */
.vtimeline { position: relative; padding-left: 28px; }
.vtimeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--c-primary-light);
}
.vtimeline__item { position: relative; padding-bottom: 26px; }
.vtimeline__item::before {
  content: "";
  position: absolute;
  left: -28px; top: 6px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--c-primary);
}
.vtimeline__item:last-child { padding-bottom: 0; }

/* ---------------- 星级评分 ---------------- */
.stars { display: inline-flex; gap: 2px; color: #ffb020; }
.stars svg { width: 16px; height: 16px; }
.stars--lg svg { width: 20px; height: 20px; }

/* ---------------- 空状态 ---------------- */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--t-weak);
}
.empty svg { width: 72px; height: 72px; margin: 0 auto 16px; opacity: .5; }

/* ---------------- 侧边栏小组件 ---------------- */
.side-widget {
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  padding: 24px;
  margin-bottom: 24px;
}
.side-widget__title {
  font-size: 17px;
  font-weight: 700;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--c-primary-light);
  position: relative;
}
.hot-list__item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed #eef1f6; }
.hot-list__item:last-child { border-bottom: none; }
.hot-list__num {
  flex: none;
  width: 22px; height: 22px;
  border-radius: var(--r-xs);
  background: #eef2f7;
  color: var(--t-sub);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-family: var(--font-num);
}
.hot-list__item:nth-child(-n+3) .hot-list__num { background: var(--c-primary); color: #fff; }
.hot-list__text { font-size: 14px; line-height: 1.6; }
.hot-list__meta { font-size: 12px; color: var(--t-weak); margin-top: 4px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
