/* =====================================================
   黑龙教育 · 前台样式  style.css v6
   ===================================================== */

/* ── Reset & 基础 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: #f4f7fb;
  color: #1f2937;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }
.muted-sm { font-size: 13px; color: #6b7280; }

/* =====================================================
   顶部导航
   ===================================================== */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}
.site-logo {
  font-size: 20px;
  font-weight: 800;
  color: #1e3a5f;
  letter-spacing: .5px;
  white-space: nowrap;
}
.header-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav-item {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  color: #374151;
  transition: all .18s;
}
.main-nav-item:hover, .main-nav-item.active { background: #eff6ff; color: #2563eb; font-weight: 600; }

#navCategories { display: flex; align-items: center; gap: 4px; }
.nav-cat {
  padding: 5px 12px; border-radius: 16px; font-size: 13px; color: #374151;
  white-space: nowrap; transition: all .18s;
}
.nav-cat:hover, .nav-cat.active { background: #2563eb; color: #fff; font-weight: 600; }

.btn-contact {
  padding: 7px 18px; background: #2563eb; color: #fff !important;
  border-radius: 20px; font-size: 13px; font-weight: 600;
  transition: background .18s; white-space: nowrap;
}
.btn-contact:hover { background: #1d4ed8; }

.mobile-menu-btn { display: none; font-size: 22px; color: #374151; padding: 4px 8px; }
.mobile-menu { background: #fff; border-top: 1px solid #e5e7eb; padding: 8px 0; }
.mobile-nav-item {
  display: block; padding: 10px 20px; font-size: 14px; color: #374151;
  border-bottom: 1px solid #f3f4f6; transition: background .15s;
}
.mobile-nav-item:last-child { border-bottom: none; }
.mobile-nav-item:hover, .mobile-nav-item.active { background: #eff6ff; color: #2563eb; font-weight: 600; }
#mobileNavCategories { border-top: 1px solid #e5e7eb; }

/* =====================================================
   轮播 Banner
   ===================================================== */
.slider { position: relative; overflow: hidden; background: #1e3a5f; }
.slider-track { display: flex; transition: transform .5s ease; }
.slide { min-width: 100%; position: relative; height: 340px; display: flex; align-items: center; }
.slide-bg { position: absolute; inset: 0; background-size: cover; background-position: center; background-color: #1e3a5f; }
.slide-content { position: relative; z-index: 2; color: #fff; }
.slide-title { font-size: 34px; font-weight: 800; line-height: 1.3; text-shadow: 0 2px 8px rgba(0,0,0,.4); margin-bottom: 10px; }
.slide-subtitle { font-size: 16px; opacity: .9; text-shadow: 0 1px 4px rgba(0,0,0,.3); margin-bottom: 20px; }
.slide-btn {
  display: inline-block; padding: 11px 30px; background: #fff; color: #1e3a5f;
  border-radius: 24px; font-weight: 700; font-size: 14px; transition: all .2s;
}
.slide-btn:hover { background: #eff6ff; transform: translateY(-1px); }
.slider-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 3; }
.slider-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.5); transition: all .2s; border: none; cursor: pointer; }
.slider-dot.active { background: #fff; width: 20px; border-radius: 4px; }
.slider-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 40px; height: 40px; background: rgba(255,255,255,.2); color: #fff;
  border-radius: 50%; font-size: 22px; display: flex; align-items: center;
  justify-content: center; transition: background .2s; border: none; cursor: pointer;
  backdrop-filter: blur(4px);
}
.slider-arrow:hover { background: rgba(255,255,255,.4); }
.slider-prev { left: 16px; }
.slider-next { right: 16px; }

/* =====================================================
   课程列表区
   ===================================================== */
.courses-section { padding: 40px 0 60px; flex: 1; }
.section-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 24px; }
.section-header h2 { font-size: 22px; font-weight: 800; color: #111827; }
.course-count { font-size: 13px; color: #6b7280; }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.course-card {
  background: #fff; border-radius: 14px; border: 1px solid #f3f4f6;
  box-shadow: 0 2px 8px rgba(0,0,0,.05); overflow: hidden;
  cursor: pointer; transition: all .22s; display: flex; flex-direction: column;
}
.course-card:hover { box-shadow: 0 10px 28px rgba(0,0,0,.12); transform: translateY(-4px); }
.course-card-cover { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.course-card-cover-placeholder {
  width: 100%; aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  display: flex; align-items: center; justify-content: center; font-size: 48px;
}
.course-card-body { padding: 16px 18px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.course-card-category {
  font-size: 11px; color: #2563eb; background: #eff6ff;
  border-radius: 4px; padding: 2px 7px; display: inline-block; font-weight: 600; width: fit-content;
}
.course-card-title { font-size: 15px; font-weight: 700; color: #111827; line-height: 1.4; }
.course-card-subtitle { font-size: 13px; color: #6b7280; line-height: 1.4; }
.course-card-meta { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid #f9fafb; }
.course-card-price { font-size: 20px; font-weight: 900; color: #dc2626; }
.course-card-chapters { font-size: 12px; color: #9ca3af; }
.course-card-arrow { margin-left: auto; font-size: 16px; color: #9ca3af; }

.course-skeleton { background: #fff; border-radius: 14px; border: 1px solid #f3f4f6; aspect-ratio: 3/2; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
.empty-tip { text-align: center; color: #9ca3af; padding: 48px 0; font-size: 15px; }

/* =====================================================
   课程详情页 — Hero
   ===================================================== */
.loading-tip { text-align: center; padding: 80px 20px; color: #6b7280; font-size: 16px; }
.error-tip { text-align: center; padding: 80px 20px; color: #dc2626; font-size: 15px; }

.course-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  padding: 44px 0 52px;
  color: #fff;
}
.hero-grid { display: grid; grid-template-columns: 1fr 400px; gap: 44px; align-items: start; }
.media-box { border-radius: 14px; overflow: hidden; position: relative; }
.hero-cover { width: 100%; aspect-ratio: 680/400; object-fit: cover; border-radius: 14px; display: block; }
.play-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.38);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: #fff; font-size: 14px; border-radius: 14px; transition: background .2s;
}
.play-overlay:hover { background: rgba(0,0,0,.55); }
.play-btn-circle {
  width: 68px; height: 68px; border-radius: 50%;
  background: rgba(255,255,255,.92); color: #1e3a5f;
  font-size: 26px; display: flex; align-items: center; justify-content: center; padding-left: 4px;
}

.course-info-panel { display: flex; flex-direction: column; gap: 18px; }
.hero-title { font-size: 24px; font-weight: 800; line-height: 1.35; color: #fff; }
.hero-subtitle { font-size: 15px; color: rgba(255,255,255,.75); }
.meta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.meta-item { font-size: 13px; color: rgba(255,255,255,.8); background: rgba(255,255,255,.1); padding: 4px 10px; border-radius: 20px; }
.meta-item strong { color: #fff; }

.price-block { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price-sale { font-size: 36px; font-weight: 900; color: #fbbf24; }
.price-origin { font-size: 16px; color: rgba(255,255,255,.45); text-decoration: line-through; }
.price-tag { font-size: 11px; background: #dc2626; color: #fff; border-radius: 4px; padding: 3px 8px; font-weight: 700; }

.buy-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-buy-main {
  display: inline-block; padding: 14px 32px; background: #2563eb; color: #fff;
  border-radius: 10px; font-size: 16px; font-weight: 700; transition: background .18s;
}
.btn-buy-main:hover { background: #1d4ed8; }
.buy-tip { font-size: 12px; color: rgba(255,255,255,.5); }

/* =====================================================
   课程详情页 — Tab
   ===================================================== */
.tab-bar { background: #fff; border-bottom: 1px solid #e5e7eb; }
.sticky-tabs { position: sticky; top: 60px; z-index: 90; }
.tab-bar .container { display: flex; gap: 0; }
.tab-btn {
  padding: 15px 22px; font-size: 14px; font-weight: 600; color: #6b7280;
  border-bottom: 3px solid transparent; transition: all .15s; background: none; cursor: pointer;
}
.tab-btn:hover { color: #2563eb; }
.tab-btn.active { color: #2563eb; border-bottom-color: #2563eb; }

.tab-content-wrap { padding: 32px 0 60px; }
.tab-panel { display: none; }
.tab-panel:not(.hidden) { display: block; }

.detail-card { background: #fff; border-radius: 14px; border: 1px solid #f3f4f6; padding: 28px 32px; margin-bottom: 20px; }
.sec-title { font-size: 17px; font-weight: 800; color: #111827; margin-bottom: 16px; }
.desc-text { font-size: 14px; color: #374151; line-height: 1.85; }

/* ── 课程目录（仿网校风格）── */
.catalog-accordion {}
.catalog-chapter {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 10px;
}
.catalog-chapter-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; background: #f8fafc; cursor: pointer;
  transition: background .15s; user-select: none;
}
.catalog-chapter-header:hover { background: #f0f4ff; }
.catalog-chapter-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: #2563eb; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.catalog-chapter-name { flex: 1; font-size: 15px; font-weight: 700; color: #111827; }
.catalog-chapter-meta { font-size: 12px; color: #9ca3af; white-space: nowrap; }
.catalog-chapter-arrow { font-size: 12px; color: #9ca3af; transition: transform .2s; }
.catalog-chapter.open .catalog-chapter-arrow { transform: rotate(180deg); }
.catalog-chapter-body { border-top: 1px solid #f3f4f6; }
/* 无章节分组时的平铺列表 */
.catalog-flat {}

.chapter-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 20px; border-bottom: 1px solid #f9fafb;
  font-size: 14px; transition: background .12s;
}
.catalog-chapter-body .chapter-row:last-child { border-bottom: none; }
.chapter-row:hover { background: #fafbff; }
.ch-index { min-width: 32px; color: #9ca3af; font-size: 12px; font-weight: 600; }
.ch-name { flex: 1; color: #374151; }
.ch-dur { font-size: 12px; color: #9ca3af; white-space: nowrap; }
.ch-free-tag { font-size: 11px; background: #dcfce7; color: #16a34a; border-radius: 4px; padding: 2px 7px; font-weight: 700; white-space: nowrap; }
.ch-lock-icon { color: #d1d5db; font-size: 14px; }

/* 试看视频 */
.free-video-wrap { margin-bottom: 16px; }
.free-video-label { font-size: 13px; color: #374151; margin-top: 6px; font-weight: 600; }

/* 学员评价 */
.review-item { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid #f3f4f6; }
.review-item:last-child { border-bottom: none; }
.review-avatar { flex-shrink: 0; }
.review-avatar img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.avatar-placeholder {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
}
.review-body { flex: 1; }
.review-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.review-name { font-weight: 700; font-size: 14px; }
.review-stars { font-size: 14px; }
.review-content { font-size: 14px; color: #374151; line-height: 1.65; }

/* =====================================================
   插件页
   ===================================================== */
.page-section { padding: 36px 0 60px; flex: 1; }
.page-title { font-size: 28px; font-weight: 900; color: #111827; margin: 0 0 6px; }
.page-subtitle { font-size: 15px; color: #6b7280; margin: 0 0 32px; }

.plugin-card {
  background: #fff; border-radius: 20px; border: 1px solid #e5e7eb;
  box-shadow: 0 4px 20px rgba(0,0,0,.06); margin-bottom: 44px; overflow: hidden;
}
.plugin-hero { display: flex; gap: 28px; align-items: flex-start; padding: 28px 32px 24px; }
.plugin-cover { width: 220px; height: 148px; object-fit: cover; border-radius: 12px; flex-shrink: 0; border: 1px solid #f3f4f6; }
.plugin-cover-ph {
  width: 220px; height: 148px; border-radius: 12px;
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  display: flex; align-items: center; justify-content: center; font-size: 56px; flex-shrink: 0;
}
.plugin-info { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.plugin-name { font-size: 22px; font-weight: 900; color: #111827; }
.plugin-subtitle { font-size: 14px; color: #6b7280; }
.plugin-software { font-size: 13px; color: #16a34a; background: #f0fdf4; border-radius: 6px; padding: 4px 10px; display: inline-block; width: fit-content; }
.plugin-desc { font-size: 14px; color: #374151; line-height: 1.7; }

.tier-section { padding: 20px 32px 28px; border-top: 1px solid #f3f4f6; }
.tier-title { font-size: 15px; font-weight: 800; color: #374151; margin: 0 0 16px; }
.tier-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tier-card {
  border: 2px solid #e5e7eb; border-radius: 14px; padding: 20px 18px;
  display: flex; flex-direction: column; gap: 10px; position: relative; transition: box-shadow .2s;
}
.tier-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.tier-featured { border-color: #a78bfa !important; background: linear-gradient(160deg, #faf5ff 0%, #fff 60%); }
.tier-badge { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 3px 10px; display: inline-block; width: fit-content; }
.tier-hot-badge { font-size: 12px; font-weight: 700; color: #d97706; background: #fffbeb; border-radius: 6px; padding: 3px 10px; display: inline-block; width: fit-content; }
.tier-name { font-size: 16px; font-weight: 800; }
.tier-price { display: flex; align-items: baseline; gap: 2px; }
.tier-price-num { font-size: 30px; font-weight: 900; }
.tier-price-unit { font-size: 13px; color: #6b7280; }
.tier-features { font-size: 13px; color: #374151; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.tier-feature-item { display: flex; align-items: flex-start; gap: 5px; }
.tier-btn {
  display: block; padding: 11px; background: #2563eb; color: #fff;
  border-radius: 8px; font-size: 13px; font-weight: 700; text-align: center;
  transition: opacity .18s; margin-top: 4px;
}
.tier-btn:hover { opacity: .88; }


/* =====================================================
   资源下载页：软件下载卡片
   ===================================================== */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.software-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 20px;
  min-height: 206px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .035);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.software-card:hover {
  transform: translateY(-2px);
  border-color: #d8dee8;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .08);
}

.software-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.software-icon {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.software-icon-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 10px;
}

.software-icon-fallback {
  width: 46px;
  height: 46px;
  border-radius: 9px;
  background: #0f9f87;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
}

.software-info {
  min-width: 0;
  flex: 1;
}

.software-name {
  margin: 0 0 7px;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 800;
}

.software-version {
  color: #059669;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 4px;
}

.software-version strong {
  font-weight: 800;
}

.software-meta {
  color: #718096;
  font-size: 12px;
  line-height: 1.65;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.software-dot {
  color: #cbd5e1;
  margin: 0 2px;
}

.software-desc {
  color: #64748b;
  font-size: 13px;
  line-height: 1.7;
  margin-top: 14px;
  flex: 1;
  overflow: hidden;
}

.software-desc p {
  margin: 0 0 5px;
}

.software-desc p:last-child {
  margin-bottom: 0;
}

.software-actions {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}

.software-notice {
  margin-top: 14px;
  padding: 12px 13px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e8edf3;
}

.software-notice-title {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.software-notice-text {
  color: #64748b;
  font-size: 12px;
  line-height: 1.75;
  word-break: break-word;
}

.software-download-btn {
  width: 100%;
  height: 38px;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background .18s ease, transform .12s ease;
}

.software-download-btn:hover {
  background: #1d4ed8;
}

.software-download-btn:active {
  transform: translateY(1px);
}

.software-download-btn.disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

.download-icon {
  font-size: 18px;
  line-height: 1;
  margin-top: -2px;
}

.software-skeleton {
  height: 206px;
  border-radius: 14px;
  background: linear-gradient(90deg, #f8fafc 25%, #f1f5f9 37%, #f8fafc 63%);
  background-size: 400% 100%;
  animation: softwareSkeleton 1.4s ease infinite;
}

@keyframes softwareSkeleton {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.resource-load-error {
  grid-column: 1 / -1;
  color: #dc2626;
  background: #fff;
  border: 1px solid #fee2e2;
  border-radius: 12px;
  padding: 20px;
}

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

@media (max-width: 620px) {
  .resource-grid {
    grid-template-columns: 1fr;
  }

  .software-card {
    padding: 17px;
  }

  .software-name {
    font-size: 17px;
  }
}

/* =====================================================
   联系我们
   ===================================================== */
.contact-section { background: linear-gradient(135deg, #1e3a5f, #0f172a); color: #fff; padding: 60px 0; }
.contact-inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.contact-text h2 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.contact-text p { font-size: 14px; opacity: .8; margin-bottom: 22px; }
.wechat-info { display: flex; align-items: center; gap: 14px; background: rgba(255,255,255,.1); border-radius: 12px; padding: 14px 20px; }
.wechat-icon { font-size: 32px; }
.wechat-label { font-size: 12px; opacity: .7; }
.wechat-id { font-size: 22px; font-weight: 800; letter-spacing: .5px; }
.contact-qrcode { text-align: center; }
.contact-qrcode img { width: 150px; height: 150px; border-radius: 12px; border: 3px solid rgba(255,255,255,.3); }
.contact-qrcode p { font-size: 12px; opacity: .7; margin-top: 8px; }

/* =====================================================
   页脚
   ===================================================== */
.site-footer { background: #0f172a; color: rgba(255,255,255,.4); padding: 20px 0; font-size: 13px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* =====================================================
   通用按钮
   ===================================================== */
button.secondary {
  background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px; padding: 6px 14px; font-size: 13px; cursor: pointer; transition: background .15s;
}
button.secondary:hover { background: rgba(255,255,255,.22); }

/* =====================================================
   响应式
   ===================================================== */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; }
  .course-info-panel { order: -1; }
}
@media (max-width: 700px) {
  .mobile-menu-btn { display: flex; }
  .header-nav { display: none; }
  .slide { height: 220px; }
  .slide-title { font-size: 22px; }
  .slide-subtitle { font-size: 13px; }
  .course-grid { grid-template-columns: 1fr; }
  .contact-inner { flex-direction: column; align-items: flex-start; }
  .tab-btn { padding: 12px 14px; font-size: 13px; }
  .tier-grid { grid-template-columns: 1fr; }
  .plugin-hero { flex-direction: column; }
  .plugin-cover, .plugin-cover-ph { width: 100%; height: 200px; }
  .tier-section, .plugin-hero { padding-left: 16px; padding-right: 16px; }
  .detail-card { padding: 20px 18px; }
}

/* 可点击的试看标签 */
.ch-free-clickable {
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.ch-free-clickable:hover {
  background: #16a34a;
  color: #fff;
  transform: scale(1.05);
}
