/* 营销商学院 H5 样式（公众号内嵌浏览器适配） */

:root {
  --primary: #f59e0b;
  --primary-dark: #d97706;
  --dark: #111827;
  --card-shadow: 0 2px 12px rgba(0,0,0,.08);
  --topbar-height: 44px;
  --tabbar-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  color: #222;
  background: #f5f5f5;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* ===== H5顶部栏 ===== */
.h5-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background: #111827;
  color: #fff;
  z-index: 1000;
}
.h5-topbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.h5-topbar .h5-title {
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.h5-back {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  text-decoration: none;
}
.h5-avatar {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  text-decoration: none;
}
.h5-avatar img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

/* ===== H5底部Tab ===== */
.h5-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tabbar-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: #fff;
  border-top: 1px solid #eee;
  display: flex;
  z-index: 1000;
}
.h5-tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 10px;
  text-decoration: none;
  gap: 2px;
  transition: color .15s;
}
.h5-tab-item i { font-size: 20px; }
.h5-tab-item.active { color: var(--primary); }
.h5-tab-item.active i { font-weight: 900; }

/* ===== H5内容区 ===== */
.h5-content {
  padding-top: var(--topbar-height);
  padding-bottom: calc(var(--tabbar-height) + var(--safe-bottom));
  min-height: 100vh;
}
.h5-content.no-topbar {
  padding-top: 0;
}

/* ===== Hero区 ===== */
.hero-section {
  background: linear-gradient(135deg, #111827 0%, #1e3a5f 100%);
  padding: 32px 20px;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(245,158,11,.08);
  top: -120px; right: -60px;
}
.hero-badge {
  display: inline-block;
  background: rgba(245,158,11,.15);
  border: 1px solid rgba(245,158,11,.3);
  color: #f59e0b;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  margin-bottom: 12px;
}
.hero-section h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  margin-bottom: 12px;
}
.hero-section .lead {
  font-size: 14px;
  color: #ccc;
  margin-bottom: 20px;
}

/* 统计数字 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 20px;
}
.stat-card {
  text-align: center;
  padding: 16px 12px;
  background: rgba(255,255,255,.05);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.1);
}
.stat-card .number {
  font-size: 22px;
  font-weight: 700;
  color: #f59e0b;
  line-height: 1;
}
.stat-card .text-secondary {
  font-size: 12px;
  margin-top: 6px;
  display: block;
}

/* ===== 信任栏 ===== */
.trust-bar {
  background: #fff;
  padding: 12px 16px;
  display: flex;
  overflow-x: auto;
  gap: 16px;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
.trust-bar::-webkit-scrollbar { display: none; }
.trust-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #666;
  flex-shrink: 0;
}
.trust-item i { color: var(--primary); }

/* ===== 板块标题 ===== */
.section-header {
  padding: 20px 16px 12px;
}
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: #111;
  margin-bottom: 4px;
}
.section-subtitle {
  font-size: 13px;
  color: #999;
}

/* ===== 课程卡片 ===== */
.course-list {
  padding: 0 16px;
}
.course-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  margin-bottom: 12px;
  transition: transform .15s;
}
.course-card:active { transform: scale(.98); }
.course-card-body {
  padding: 12px;
  display: flex;
  gap: 12px;
}
.course-card-cover {
  width: 120px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #1e3a5f, #111827);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.course-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.course-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.course-card-info .title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-card-info .meta {
  font-size: 12px;
  color: #999;
  margin-bottom: 6px;
}
.course-card-info .badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.course-card-info .badges .badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
}
.course-card-info .bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}
.price {
  color: #e53e3e;
  font-size: 16px;
  font-weight: 700;
}
.original-price {
  color: #ccc;
  text-decoration: line-through;
  font-size: 12px;
  margin-left: 4px;
}
.badge-level-1 { background: #10b981 !important; }
.badge-level-2 { background: #3b82f6 !important; }
.badge-level-3 { background: #8b5cf6 !important; }

/* ===== 按钮 ===== */
.btn-primary { background: var(--primary); border-color: var(--primary); color: #000; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #000; }
.btn-warning { background: var(--primary); border-color: var(--primary); color: #000; }
.btn-warning:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #000; }
.btn {
  transition: transform .1s;
  -webkit-appearance: none;
}
.btn:active { transform: scale(.97); }

/* ===== 讲师卡片 ===== */
.teacher-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 16px 16px;
  -webkit-overflow-scrolling: touch;
}
.teacher-scroll::-webkit-scrollbar { display: none; }
.teacher-card {
  min-width: 140px;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 20px 12px;
  text-align: center;
  flex-shrink: 0;
}
.teacher-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  margin: 0 auto 8px;
  overflow: hidden;
}
.teacher-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* ===== 四步路径 ===== */
.step-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 16px 20px;
}
.step-item {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
}
.step-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(245,158,11,.15);
  border: 1px solid rgba(245,158,11,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  font-size: 18px;
  color: #f59e0b;
}

/* ===== 咨询表单 ===== */
.consult-section {
  padding: 20px 16px;
}
.consult-form {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 20px 16px;
}

/* ===== 登录页 ===== */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #111827, #1e3a5f);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}
.login-logo {
  width: 72px;
  height: 72px;
  background: rgba(245,158,11,.15);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 16px;
}
.login-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}
.login-desc {
  font-size: 14px;
  color: #aaa;
  margin-bottom: 40px;
}
.wechat-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 300px;
  padding: 14px;
  background: #07c160;
  color: #fff;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity .15s;
}
.wechat-login-btn:active { opacity: .85; }
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 300px;
  margin: 24px 0;
  color: #666;
  font-size: 13px;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #444;
}
.login-other-links {
  display: flex;
  gap: 20px;
  font-size: 14px;
}
.login-other-links a {
  color: #aaa;
  text-decoration: none;
}

/* ===== 用户中心 ===== */
.user-header-card {
  background: linear-gradient(135deg, #111827, #1e3a5f);
  margin: -1px -1px 0;
  padding: 24px 20px 20px;
  color: #fff;
}
.user-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid rgba(245,158,11,.5);
  overflow: hidden;
  margin-bottom: 10px;
}
.user-avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.user-name { font-size: 18px; font-weight: 700; }
.user-stats {
  display: flex;
  gap: 24px;
  margin-top: 16px;
}
.user-stat-item {
  text-align: center;
}
.user-stat-item .num { font-size: 18px; font-weight: 700; color: var(--primary); }
.user-stat-item .label { font-size: 12px; color: #aaa; margin-top: 2px; }

/* 用户菜单列表 */
.user-menu {
  background: #fff;
  margin: 12px 16px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}
.user-menu-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #f5f5f5;
  text-decoration: none;
  color: #333;
  font-size: 15px;
  transition: background .1s;
}
.user-menu-item:active { background: #f9f9f9; }
.user-menu-item:last-child { border-bottom: none; }
.user-menu-item i {
  width: 28px;
  color: var(--primary);
  font-size: 16px;
}
.user-menu-item .menu-text { flex: 1; margin-left: 10px; }
.user-menu-item .menu-arrow { color: #ccc; font-size: 12px; }

/* ===== 课程详情页 ===== */
.course-detail-cover {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #1e3a5f, #111827);
  position: relative;
  overflow: hidden;
}
.course-detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.course-detail-info {
  background: #fff;
  padding: 16px;
  margin-top: -20px;
  border-radius: 20px 20px 0 0;
  position: relative;
}
.course-detail-price {
  font-size: 24px;
  font-weight: 700;
  color: #e53e3e;
}

/* 章节列表 */
.chapter-list {
  background: #fff;
  margin: 12px 16px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}
.chapter-header {
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 1px solid #f0f0f0;
}
.lesson-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #f8f8f8;
  font-size: 14px;
  color: #333;
  text-decoration: none;
}
.lesson-item:active { background: #f9f9f9; }
.lesson-item .lesson-title { flex: 1; }
.lesson-item .lesson-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  font-size: 10px;
  background: #f0f0f0;
  color: #999;
}
.lesson-item .lesson-icon.done { background: #d1fae5; color: #059669; }
.lesson-item .lesson-icon.free { background: #fef3c7; color: #d97706; }
.lesson-item .lesson-duration { color: #999; font-size: 12px; margin-left: 8px; }

/* 底部操作栏（悬浮在tabbar之上，z-index高于tabbar的1000） */
.bottom-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  padding: 8px 16px calc(8px + var(--tabbar-height) + var(--safe-bottom));
  display: flex;
  gap: 10px;
  z-index: 1001;
  border-top: 1px solid #eee;
  box-shadow: 0 -2px 10px rgba(0,0,0,.08);
}
.bottom-action-bar .btn-buy {
  flex: 1;
  padding: 12px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
}

/* ===== 秒杀页 ===== */
.flash-countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
}
.countdown-block {
  background: rgba(0,0,0,.3);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 20px;
  font-weight: 700;
  min-width: 36px;
  text-align: center;
}
.countdown-sep { font-size: 18px; font-weight: 700; }
.countdown-label { font-size: 13px; margin-left: 8px; }
.stock-bar {
  height: 8px;
  background: #fee2e2;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}
.stock-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #dc2626, #f59e0b);
  border-radius: 4px;
  transition: width .3s;
}

/* ===== 评价 ===== */
.review-stars { color: var(--primary); }
.review-stars .empty { color: #ddd; }

/* ===== 打卡日历 ===== */
.checkin-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 12px;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 14px;
}
.cal-day.checked { background: #d1fae5; color: #059669; }
.cal-day.today { border: 2px solid var(--primary); }

/* ===== 表单样式 ===== */
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245,158,11,.15);
}

/* ===== 页面切换过渡 ===== */
.tab-pane { animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== Toast 提示 ===== */
.toast-container { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 9999; width: calc(100% - 32px); max-width: 360px; }
.toast { border-radius: 10px; }

/* ===== 后台管理（桌面端专用，H5不改） ===== */
.admin-sidebar {
  width: 220px;
  height: 100vh;
  background: #1e293b;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}
.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }
.admin-sidebar .brand {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  color: #f59e0b;
  font-weight: 700;
  font-size: 1.1rem;
}
.admin-sidebar .nav-link {
  color: #94a3b8;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .9rem;
  transition: all .15s;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
  color: #fff;
  background: rgba(245,158,11,.15);
  border-left: 3px solid #f59e0b;
}
.admin-sidebar .nav-section {
  color: #475569;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 16px 20px 6px;
}
.admin-content {
  margin-left: 220px;
  min-height: 100vh;
  background: #f8fafc;
}
.admin-topbar {
  background: #fff;
  padding: 14px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.admin-page { padding: 24px; }
.table-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.table thead th {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  font-size: .85rem;
  color: #64748b;
  font-weight: 600;
}

/* 状态徽章 */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 500;
}
.status-on { background: #d1fae5; color: #065f46; }
.status-off { background: #fee2e2; color: #991b1b; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-paid { background: #d1fae5; color: #065f46; }

/* 表格hover */
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: #f8fafc; }

/* 学习页优化 */
#videoPlayer { background: #000; }

/* 桌面端显示侧边栏 */
@media (min-width: 769px) {
  .admin-sidebar { display: block; }
  .admin-content { margin-left: 220px; }
}
/* 移动端隐藏侧边栏 */
@media (max-width: 768px) {
  .admin-sidebar { display: none; left: -220px; transition: left .3s; }
  .admin-sidebar.show { display: block; left: 0; z-index: 200; }
  .admin-content { margin-left: 0; }
}

/* ===== 用户中心子页面公共样式 ===== */
.user-scroll-x::-webkit-scrollbar { display: none; }
.user-sub-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.user-sub-card-header {
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
}
.user-sub-notice {
  margin: 12px 16px 0;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
}
.user-sub-notice-success {
  background: #f0fdf4;
  color: #065f46;
  border: 1px solid #bbf7d0;
}
.user-sub-notice-danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.user-filter-chip {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  background: #fff;
  color: #666;
  text-decoration: none;
  border: 1px solid #e5e7eb;
  transition: all .15s;
  margin-right: 8px;
}
.user-filter-chip.active {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
  font-weight: 600;
}
.user-filter-chip:active { transform: scale(.95); }
.user-empty {
  text-align: center;
  padding: 40px 16px;
  color: #9ca3af;
}
.user-empty i {
  font-size: 2.5rem;
  margin-bottom: 8px;
  display: block;
}
.user-empty p {
  font-size: 13px;
  margin: 4px 0 0;
}
