:root {
  --teal: #00b8ae;
  --teal-d: #008f87;
  --teal-dd: #006f69;
  --teal-xl: #e0f9f8;
  --teal-l: #b2f0ed;
  --gold: #f5a623;
  --text: #1a2a2a;
  --text-m: #4a6060;
  --text-l: #7a9090;
  --bg: #f4fffe;
  --white: #fff;
  --radius: 18px;
  --shadow: 0 4px 24px rgba(0,184,174,0.10);
  --shadow-h: 0 8px 40px rgba(0,184,174,0.22);
}

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

body {
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ── Hero ── */
.courses-hero {
  background: linear-gradient(135deg, var(--teal-dd) 0%, var(--teal) 60%, #00d4c8 100%);
  padding: 64px 40px 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.courses-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.courses-hero h1 {
  font-size: 2.6rem; font-weight: 800; color: #fff;
  letter-spacing: 2px; margin-bottom: 12px; position: relative;
}
.courses-hero p {
  font-size: 1.1rem; color: rgba(255,255,255,0.85); max-width: 560px;
  margin: 0 auto 28px; position: relative;
}
.hero-stats {
  display: flex; justify-content: center; gap: 48px;
  position: relative;
}
.hero-stat { text-align: center; }
.hero-stat .num { font-size: 2rem; font-weight: 800; color: #fff; }
.hero-stat .lbl { font-size: 0.85rem; color: rgba(255,255,255,0.75); margin-top: 2px; }

/* ── Tab Nav ── */
.tab-section { padding: 0 40px; max-width: 1280px; margin: 0 auto; }

.tab-nav-wrap {
  padding: 32px 0 0;
  overflow: hidden;
}
.tab-nav {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  display: flex; gap: 0;
  background: var(--white);
  border-radius: 50px;
  padding: 6px;
  box-shadow: 0 2px 20px rgba(0,184,174,0.13);
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 10px 28px;
  border: none; background: transparent;
  border-radius: 50px;
  font-size: 0.95rem; font-weight: 600;
  color: var(--text-m);
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--teal); }
.tab-btn.active {
  background: linear-gradient(135deg, var(--teal), var(--teal-d));
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,184,174,0.35);
}

/* ── Tab Panels ── */
.tab-panel { display: none; padding: 36px 0 64px; }
.tab-panel.active { display: block; }

.panel-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 32px;
}
.panel-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, var(--teal), var(--teal-d));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; flex-shrink: 0;
}
.panel-title { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.panel-sub { font-size: 0.9rem; color: var(--text-l); margin-top: 2px; }

/* ── Course Grid ── */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.courses-grid.two-col { grid-template-columns: repeat(2, 1fr); }
.courses-grid.one-col { grid-template-columns: 1fr; }

/* ── Course Card ── */
.course-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
}
.course-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-h);
}

.card-top {
  background: linear-gradient(135deg, var(--teal-xl) 0%, #c8f5f3 100%);
  padding: 22px 22px 16px;
  position: relative;
}
.card-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--teal), var(--teal-d));
  color: #fff; font-size: 0.72rem; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
  margin-bottom: 10px;
}
.card-name {
  font-size: 1.15rem; font-weight: 800; color: var(--text);
  line-height: 1.3; margin-bottom: 8px;
}
.card-desc {
  font-size: 0.85rem; color: var(--text-m); line-height: 1.5;
}
.card-pop {
  position: absolute; top: 16px; right: 16px;
  background: var(--gold); color: #fff;
  font-size: 0.7rem; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
}

.card-body { padding: 18px 22px; flex: 1; display: flex; flex-direction: column; gap: 14px; }

/* enrollment + rating row */
.card-meta {
  display: flex; align-items: center; justify-content: space-between;
}
.enroll-info {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem; color: var(--text-m);
}
.enroll-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal); display: inline-block;
}
.enroll-num { font-weight: 700; color: var(--teal); }
.rating {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.82rem; color: var(--text-m);
}
.stars { color: var(--gold); letter-spacing: -1px; }
.rating-num { font-weight: 700; color: var(--text); }

/* certs */
.card-certs { display: flex; flex-wrap: wrap; gap: 6px; }
.cert-tag {
  background: var(--teal-xl); color: var(--teal-d);
  font-size: 0.72rem; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
  border: 1px solid var(--teal-l);
}

/* skills */
.card-skills { }
.skills-label { font-size: 0.78rem; color: var(--text-l); margin-bottom: 6px; font-weight: 600; }
.skills-list { display: flex; flex-wrap: wrap; gap: 5px; }
.skill-chip {
  background: #f0fffe; color: var(--teal-dd);
  font-size: 0.72rem; padding: 2px 9px; border-radius: 12px;
  border: 1px solid var(--teal-l);
}

/* teachers */
.card-teachers { }
.teachers-label { font-size: 0.78rem; color: var(--text-l); margin-bottom: 10px; font-weight: 600; }
.teachers-row { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.teacher-item {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  text-decoration: none; color: inherit;
  transition: transform 0.2s;
}
.teacher-item:hover { transform: translateY(-3px); }
.teacher-item:hover .teacher-avatar { border-color: var(--teal); }
.teacher-item:hover .teacher-name { color: var(--teal); }
.teacher-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  border: 2px solid var(--teal-l);
  background: var(--teal-xl);
}
.teacher-avatar img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  display: block;
}
.teacher-name { font-size: 0.75rem; color: var(--text-m); font-weight: 600; text-align: center; }

/* highlights */
.card-highlights { }
.highlights-label { font-size: 0.78rem; color: var(--text-l); margin-bottom: 6px; font-weight: 600; }
.highlights-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.highlights-list li {
  font-size: 0.8rem; color: var(--text-m);
  display: flex; align-items: flex-start; gap: 6px;
}
.highlights-list li::before {
  content: '✦'; color: var(--teal); font-size: 0.65rem; margin-top: 3px; flex-shrink: 0;
}

/* card footer */
.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--teal-xl);
  display: flex; align-items: center;
  gap: 10px;
}
.consult-btn {
  flex: 1;
  background: linear-gradient(135deg, var(--teal), var(--teal-d));
  color: #fff; border: none; border-radius: 50px;
  padding: 10px 20px; font-size: 0.88rem; font-weight: 700;
  cursor: pointer; transition: opacity 0.2s, transform 0.15s;
  text-align: center; white-space: nowrap;
}
.consult-btn:hover { opacity: 0.88; transform: scale(1.03); }
.detail-link {
  flex-shrink: 0;
  font-size: 0.82rem; color: var(--teal); font-weight: 600;
  white-space: nowrap; text-decoration: none;
  padding: 10px 16px; border-radius: 50px;
  border: 1.5px solid var(--teal-l);
  transition: background 0.2s;
  display: inline-block;
}
.detail-link:hover { background: var(--teal-xl); }

/* ── Featured (wide) card for flagship courses ── */
.course-card.featured {
  grid-column: 1 / -1;
  flex-direction: row;
}
.course-card.featured .card-top {
  width: 320px; flex-shrink: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: 32px 28px;
}
.course-card.featured .card-name { font-size: 1.4rem; }
.course-card.featured .card-body { padding: 24px 28px; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .courses-grid { grid-template-columns: repeat(2, 1fr); }
  .courses-grid.one-col { grid-template-columns: 1fr; }
  .course-card.featured { flex-direction: column; }
  .course-card.featured .card-top { width: 100%; }
}
@media (max-width: 768px) {
  .courses-hero { padding: 40px 20px 36px; }
  .courses-hero h1 { font-size: 1.8rem; }
  .hero-stats { gap: 24px; }
  .tab-section { padding: 0 16px; }
  .tab-btn { padding: 8px 16px; font-size: 0.85rem; }
  .courses-grid, .courses-grid.two-col { grid-template-columns: 1fr; }
  .course-card.featured { flex-direction: column; }
  .course-card.featured .card-top { width: 100%; }

  /* 移动端吸顶 */
  .tab-nav-wrap {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #f4fffe;
    padding: 10px 0;
    margin: 0 -16px;
    overflow: hidden;
  }
  .tab-nav {
    border-radius: 0;
    box-shadow: 0 2px 12px rgba(0,184,174,0.12);
    margin: 0 16px;
  }
}
