/* 🍞 @FILE static/course.css — 学员端四页共用样式（课程中心 / 详情 / 学习 / 登录）
 *
 * @WHY 一页一个 CSS 会让四个页面各抄一遍按钮与卡片，改一处漏三处
 *      （本项目 base.css 的文件头已明确记录过这类教训）。故四页共用本文件。
 *
 * @GOTCHA 本文件**复用 base.css 的令牌**（--color-accent / --radius / --shadow-* 等），
 *      不另定义一套颜色 —— 否则学员端与官网首页会是两种观感。
 * @GOTCHA 只做加法：不改 base.css 里的任何既有类，避免波及 /about、/privacy、/terms。
 *
 * @COUPLED templates/courses.html、course.html、course_learn.html、course_login.html、
 *          static/base.css（令牌来源）
 */

/* ───────── 页头 ───────── */
.course-body { background: var(--color-background); }
.c-nav { background: #fff; border-bottom: 1px solid var(--color-border); position: sticky; top: 0; z-index: 20; }
.c-nav-in { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: var(--s4); }
.c-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px;
           color: var(--color-primary); text-decoration: none; }
.c-brand i { width: 28px; height: 28px; border-radius: 8px; background: var(--color-accent); color: #fff;
             display: grid; place-items: center; font-size: 14px; font-weight: 800; font-style: normal; }
.c-nav-links { display: flex; align-items: center; gap: var(--s5); }
.c-nav-links a { color: var(--color-secondary); text-decoration: none; font-size: 15px; font-weight: 600; }
.c-nav-links a:hover { color: var(--color-accent); }
.c-nav-links a.is-active { color: var(--color-accent); }

/* ───────── Hero ───────── */
.c-hero { background: var(--color-primary); color: #fff; padding: var(--s8) 0 var(--s7); }
.c-hero h1 { color: #fff; font-size: clamp(26px, 4vw, 38px); margin-bottom: var(--s3); }
.c-hero-sub { color: rgba(255,255,255,.82); font-size: 16px; max-width: 640px; margin-bottom: var(--s5); }
.c-hero-actions { display: flex; gap: var(--s3); flex-wrap: wrap; }
/* @GOTCHA 深底上的描边按钮要单独调，base.css 的 .btn-outline 是给浅底写的（深字浅边），
   直接用在深色 Hero 上会变成"黑字看不见"。 */
.c-btn-light { color: #fff; border-color: rgba(255,255,255,.45); }
.c-btn-light:hover { background: rgba(255,255,255,.1); border-color: #fff; color: #fff; }

/* ───────── 区块与状态 ───────── */
.c-section { padding: var(--s7) var(--s5) var(--s8); }
.c-section-head { display: flex; align-items: baseline; gap: var(--s3); margin-bottom: var(--s5);
                  max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.c-section-head h1, .c-section-head h2 { font-size: 22px; }
.c-count { color: var(--color-muted-foreground); font-size: 14px; }
.c-state { color: var(--color-muted-foreground); font-size: 15px; padding: var(--s6) 0; text-align: center; }
.c-state-err { color: #B91C1C; }
.c-empty-title { font-weight: 700; color: var(--color-foreground); margin-bottom: 6px; }
.c-empty-sub { font-size: 14px; }

/* ───────── 课程卡片 ───────── */
.c-grid { display: grid; gap: var(--s5); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
          max-width: var(--maxw); margin: 0 auto; }
.c-card { display: block; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg);
          overflow: hidden; text-decoration: none; color: inherit;
          transition: transform .18s ease, box-shadow .18s ease; }
.c-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.c-card-cover { position: relative; aspect-ratio: 16 / 9; background: var(--color-muted); overflow: hidden; }
.c-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 无封面时的占位：用品牌色渐变 + 课程首字，比纯灰块体面，也一眼能区分课程 */
.c-cover-ph { display: grid; place-items: center;
              background: linear-gradient(135deg, #0F172A 0%, #0369A1 100%); }
.c-cover-ph span { color: rgba(255,255,255,.9); font-size: 44px; font-weight: 800; }
.c-cover-lg { aspect-ratio: 16 / 9; border-radius: var(--radius-lg); }
.c-badge { position: absolute; right: 10px; top: 10px; background: var(--color-cta); color: #fff;
           font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.c-card-body { padding: var(--s4); }
.c-card-title { font-size: 16px; font-weight: 700; color: var(--color-foreground); margin-bottom: 6px;
                display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-card-sub { font-size: 13.5px; color: var(--color-muted-foreground); margin-bottom: 8px;
              display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
               font-size: 13px; color: var(--color-muted-foreground); }
.c-dot { opacity: .5; }

/* ───────── 进度条 ───────── */
.c-progress { height: 6px; background: var(--color-muted); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.c-progress i { display: block; height: 100%; background: var(--color-accent); border-radius: 999px;
                transition: width .3s ease; }
.c-progress-lg { height: 8px; }

/* ───────── 详情页 ───────── */
.c-detail-wrap { padding: var(--s6) var(--s5) var(--s8); }
.c-back { display: inline-block; margin-bottom: var(--s4); font-size: 14px;
          color: var(--color-muted-foreground); text-decoration: none; }
.c-back:hover { color: var(--color-accent); }
.c-detail-head { display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: var(--s6); align-items: start; }
.c-detail-cover { border-radius: var(--radius-lg); overflow: hidden; background: var(--color-muted); }
.c-detail-cover img { width: 100%; display: block; }
.c-detail-info h1 { font-size: clamp(22px, 3vw, 30px); margin-bottom: var(--s2); }
.c-lede { color: var(--color-muted-foreground); font-size: 15px; margin-bottom: var(--s3); }
.c-detail-meta { display: flex; gap: 6px; flex-wrap: wrap; font-size: 14px;
                 color: var(--color-muted-foreground); margin-bottom: var(--s5); }
.c-detail-actions { display: flex; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }
.c-detail-body { margin-top: var(--s7); }
.c-detail-main h2 { font-size: 18px; margin: var(--s6) 0 var(--s3); }
.c-rich { white-space: pre-wrap; color: var(--color-secondary); font-size: 15px; line-height: 1.9; }

/* ───────── 课时目录 ───────── */
.c-lesson-list { list-style: none; border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }
.c-lesson { display: flex; align-items: center; gap: var(--s3); padding: 14px var(--s4);
            background: #fff; border-bottom: 1px solid var(--color-border); font-size: 15px; }
.c-lesson:last-child { border-bottom: 0; }
.c-lesson-no { width: 24px; color: var(--color-muted-foreground); font-size: 13px; flex: 0 0 auto; }
.c-lesson-title { flex: 1; min-width: 0; }
.c-lesson-right { display: flex; align-items: center; gap: var(--s3); flex: 0 0 auto; }
.c-lesson-dur { color: var(--color-muted-foreground); font-size: 13px; }
.c-tag-free { background: #E7F5EC; color: #137A3E; font-size: 12px; font-weight: 700;
              padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.c-tag-lock { background: var(--color-muted); color: var(--color-muted-foreground); font-size: 12px;
              font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }

/* ───────── 兑换卡 ───────── */
.c-redeem-card { max-width: 520px; background: #fff; border: 1px solid var(--color-border);
                 border-radius: var(--radius-lg); padding: var(--s6); box-shadow: var(--shadow-card); }
.c-label { display: block; font-size: 13px; font-weight: 700; color: var(--color-secondary); margin: var(--s4) 0 6px; }
.c-input { width: 100%; min-height: 44px; padding: 11px 14px; font-size: 15px; font-family: inherit;
           color: var(--color-foreground); background: #fff; border: 1px solid var(--color-border);
           border-radius: var(--radius); }
.c-input:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(3,105,161,.14); }
.c-code-input { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
                letter-spacing: .12em; font-size: 17px; text-align: center; }
.c-btn-block { width: 100%; margin-top: var(--s5); }
.c-msg { margin-top: var(--s3); font-size: 14px; }
.c-msg.is-err { color: #B91C1C; }
.c-msg.is-ok { color: #137A3E; }
.c-hint { font-size: 13px; color: var(--color-muted-foreground); margin-top: var(--s4); }

/* ───────── 学习页 ───────── */
.course-learn-body { background: #0B1220; }
.course-learn-body .c-nav { background: #0F172A; border-bottom-color: rgba(255,255,255,.1); }
.course-learn-body .c-brand { color: #fff; }
.course-learn-body .c-nav-links a { color: rgba(255,255,255,.75); }
.course-learn-body .c-nav-links a:hover { color: #fff; }
.c-learn-wrap { max-width: 1440px; margin: 0 auto; padding: var(--s5); }
.c-learn-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s5); align-items: start; }
.c-player-box { position: relative; background: #000; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16 / 9; }
.c-video { width: 100%; height: 100%; display: block; background: #000; }
.c-noplay { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center;
            gap: var(--s3); background: #0F172A; color: #fff; text-align: center; padding: var(--s5); }
.c-noplay-title { font-weight: 700; font-size: 17px; }
.c-noplay-sub { color: rgba(255,255,255,.65); font-size: 14px; }
.c-learn-title { color: #fff; font-size: 19px; margin: var(--s5) 0 var(--s2); }
.c-learn-meta { color: rgba(255,255,255,.6); font-size: 14px; }
.c-lesson-col { background: #0F172A; border: 1px solid rgba(255,255,255,.09);
                border-radius: var(--radius-lg); overflow: hidden; }
.c-lesson-head { padding: var(--s4) var(--s4) var(--s3); border-bottom: 1px solid rgba(255,255,255,.09); }
.c-lesson-head h2 { color: #fff; font-size: 15px; margin-bottom: var(--s2); }
.c-lesson-progress { color: rgba(255,255,255,.55); font-size: 13px; }
.c-lesson-col .c-progress { background: rgba(255,255,255,.12); }
.c-lesson-col .c-progress i { background: #38BDF8; }
.c-learn-list { list-style: none; max-height: 62vh; overflow-y: auto; }
.c-learn-item { display: flex; align-items: center; gap: 10px; padding: 12px var(--s4); cursor: pointer;
                color: rgba(255,255,255,.78); font-size: 14px; border-bottom: 1px solid rgba(255,255,255,.06); }
.c-learn-item:hover { background: rgba(255,255,255,.05); }
.c-learn-item.is-cur { background: rgba(56,189,248,.14); color: #fff; font-weight: 600; }
.c-learn-item.is-locked { color: rgba(255,255,255,.42); }
.c-learn-no { width: 22px; flex: 0 0 auto; text-align: center; font-size: 12px; }
.c-learn-item.is-done .c-learn-no { color: #4ADE80; }
.c-learn-name { flex: 1; min-width: 0; }
.c-learn-dur { font-size: 12px; color: rgba(255,255,255,.45); flex: 0 0 auto; }

/* ───────── 登录页 ───────── */
.c-auth-wrap { display: grid; place-items: center; padding: var(--s8) var(--s5); min-height: 62vh; }
.c-auth-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--color-border);
               border-radius: var(--radius-lg); padding: var(--s6); box-shadow: var(--shadow-lift); }
.c-auth-card h1 { font-size: 22px; margin-bottom: var(--s2); }
.c-tabs { display: flex; gap: var(--s2); border-bottom: 1px solid var(--color-border); margin: var(--s4) 0 0; }
.c-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 4px;
         font-size: 15px; font-weight: 700; font-family: inherit; color: var(--color-muted-foreground);
         cursor: pointer; }
.c-tab.is-active { color: var(--color-accent); border-bottom-color: var(--color-accent); }
.c-pwd-wrap { position: relative; }
.c-pwd-wrap .c-input { padding-right: 46px; }
.c-pwd-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
             background: none; border: 0; cursor: pointer; font-size: 16px; padding: 8px;
             line-height: 1; opacity: .7; }
.c-pwd-eye:hover { opacity: 1; }
.c-auth-foot { text-align: center; }
.c-auth-foot a { color: var(--color-accent); }

/* ───────── toast ───────── */
.ct-toast { position: fixed; left: 50%; bottom: 36px; transform: translate(-50%, 20px);
            background: #0F172A; color: #fff; font-size: 14px; padding: 11px 20px; border-radius: 999px;
            box-shadow: var(--shadow-float); opacity: 0; pointer-events: none;
            transition: opacity .2s ease, transform .2s ease; z-index: 999; max-width: 90vw; }
.ct-toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.ct-toast.is-ok { background: #137A3E; }
.ct-toast.is-err { background: #B91C1C; }

/* ───────── 响应式 ───────── */
@media (max-width: 960px) {
  .c-detail-head { grid-template-columns: 1fr; }
  .c-learn-grid { grid-template-columns: 1fr; }
  .c-learn-list { max-height: none; }
}
@media (max-width: 640px) {
  .c-nav-in { min-height: 56px; }
  .c-nav-links { gap: var(--s4); }
  .c-hero { padding: var(--s7) 0 var(--s6); }
  .c-grid { grid-template-columns: 1fr; }
}
