/* AI 分身 × AI 剪輯 會員教室：版面沿用 threads-learning-path.css（n8n 課同一套），這裡只補教室頁新增的元件 */

/* 課程首頁：左邊標題＋權限狀態卡，右邊課程海報（手機改成海報在上） */
.classroom-hero { max-width: 1244px; margin: 0 auto; padding: 64px 28px 8px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 380px); gap: clamp(28px, 5vw, 64px); align-items: center; }
.classroom-poster { margin: 0; padding: 7px; border: 1px solid rgba(200, 255, 0, .72); border-radius: 16px; background: #07110f; box-shadow: 10px 10px 0 #c8ff00, 0 24px 58px rgba(7, 17, 15, .18); }
.classroom-poster img { display: block; width: 100%; height: auto; border-radius: 10px; }
.classroom-launch { color: var(--green-800) !important; font-weight: 800; }
.classroom-hero h1 { margin: 0 0 18px; font-size: clamp(40px, 5vw, 64px); line-height: 1.2; letter-spacing: -.03em; font-weight: 900; }
.classroom-hero .lead { margin-bottom: 26px; }
.classroom-status { max-width: 760px; padding: 24px 26px; border: 1px solid var(--mint-300); border-left: 4px solid var(--green-800); border-radius: 12px; background: var(--mint-50); }
.classroom-status p { margin: 0 0 12px; color: #35413e; line-height: 1.8; }
.classroom-status .classroom-status-title { margin-bottom: 8px; font-family: var(--serif); color: var(--green-950); font-size: 22px; font-weight: 700; }
.classroom-status strong { color: var(--green-950); }
.classroom-email { overflow-wrap: anywhere; }
.classroom-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 4px; }
.classroom-status .classroom-hint,
.lesson-paywall-inline .classroom-hint { margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.classroom-status a:not(.btn),
.lesson-paywall-inline a:not(.btn) { color: var(--green-800); font-weight: 800; }
.classroom-progress { height: 8px; margin: 16px 0 8px; overflow: hidden; border-radius: 999px; background: var(--mint-200); }
.classroom-progress span { display: block; height: 100%; border-radius: inherit; background: var(--green-800); transition: width .3s ease; }
.classroom-status .classroom-progress-text { color: var(--muted); font-size: 14px; }
.account-bar .account-email { overflow-wrap: anywhere; }

/* 單元列表：影片卡牆。縮圖是課程海報裁切，放了 YouTube 影片就換成影片封面 */
.ai-video-classroom .roadmap { padding-top: 56px; }
.ai-video-classroom .roadmap-table { border: 0; background: none; box-shadow: none; overflow: visible; }
.card-part + .card-part { margin-top: 40px; }
.card-part-label { display: flex; align-items: baseline; gap: 12px; margin: 0 0 16px; }
.card-part-label strong { font-family: var(--serif); color: var(--green-950); font-size: 26px; font-weight: 900; }
.card-part-label span { color: var(--muted); font-size: 14px; font-weight: 800; }
.lesson-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.lesson-card { cursor: pointer; border-radius: 12px; outline-offset: 4px; }
.lesson-thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; background: #07110f; box-shadow: var(--shadow); }
.lesson-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.lesson-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7, 17, 15, 0) 40%, rgba(7, 17, 15, .82) 100%); }
.lesson-card:hover .lesson-thumb img,
.lesson-card:focus-visible .lesson-thumb img { transform: scale(1.05); }
.lesson-thumb-num { position: absolute; left: 12px; bottom: 6px; z-index: 1; color: #c8ff00; font-family: var(--serif); font-size: 38px; font-weight: 900; line-height: 1; text-shadow: 0 2px 12px rgba(0, 0, 0, .5); }
.lesson-thumb-chip { position: absolute; right: 10px; top: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; color: #fff; background: rgba(7, 17, 15, .72); font-size: 12px; font-weight: 800; backdrop-filter: blur(4px); }
.lesson-card.is-complete .lesson-thumb-chip { color: #07110f; background: #c8ff00; }
.lesson-card.is-locked .lesson-thumb img { filter: grayscale(.35) brightness(.8); }
.lesson-card-title { display: block; margin-top: 10px; color: var(--green-950); font-size: 16px; font-weight: 800; line-height: 1.4; }
.catalog-part { margin: 18px 9px 6px; color: var(--green-600); font-size: 12px; font-weight: 850; letter-spacing: .06em; }
.catalog-part:first-child { margin-top: 0; }

/* 單元頁 */
.ai-video-classroom .lesson-article h1 { margin-bottom: 26px; font-size: clamp(32px, 3.4vw, 46px); line-height: 1.3; }
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 0 0 26px; overflow: hidden; border-radius: 12px; background: #0f1e1a; box-shadow: var(--shadow); }
.video-frame iframe,
.video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
/* 還沒放影片：同一個 16:9 框，字多時讓框長高而不是被切掉 */
.video-placeholder { display: grid; place-items: center; padding: 24px; overflow: visible; color: var(--white); text-align: center; background: linear-gradient(145deg, var(--green-900), var(--green-800)); }
.video-placeholder > div { display: grid; justify-items: center; gap: 8px; max-width: 420px; }
.video-placeholder-icon { width: 56px; height: 56px; display: grid; place-items: center; padding-left: 4px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 50%; font-size: 20px; }
.video-placeholder strong { font-family: var(--serif); font-size: clamp(18px, 2.4vw, 24px); line-height: 1.5; text-wrap: balance; }
.video-placeholder small { color: #cfe2dd; font-size: 14px; }
.lesson-deliverable { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 0 0 30px; padding: 16px 20px; border: 1px solid var(--mint-300); border-radius: 10px; background: var(--mint-50); }
.lesson-deliverable span { color: var(--muted); font-size: 14px; font-weight: 800; }
.lesson-deliverable strong { color: var(--green-950); font-family: var(--serif); font-size: 19px; }
.lesson-notes > h2,
.lesson-downloads > h2 { margin: 0 0 14px; font-size: 22px; }
.lesson-notes .lesson-full-content > :first-child { margin-top: 0; }
.lesson-notes .lesson-full-content h2 { margin-top: 36px; font-size: 24px; }
.lesson-notes .lesson-full-content img { max-width: 100%; height: auto; border-radius: 8px; }
.code-copy { position: relative; }
.code-copy pre { padding-top: 44px; }
.code-copy-button { position: absolute; top: 8px; right: 8px; min-height: 32px; padding: 4px 14px; border: 1px solid var(--mint-300); border-radius: 6px; background: #fff; color: var(--green-800); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.code-copy-button:hover { background: var(--mint-50); }
.code-copy-button.is-copied { border-color: var(--green-800); background: var(--green-800); color: #fff; }
.ai-video-classroom .lesson-full-content a { color: var(--green-800); font-weight: 750; overflow-wrap: anywhere; }
.lesson-preview-content { margin-bottom: 8px; }
.lesson-downloads { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.download-list { display: flex; flex-wrap: wrap; gap: 10px; }
.download-list .btn { max-width: 100%; min-height: 44px; gap: 8px; padding: 9px 18px; text-align: left; }
.lesson-feedback-cta { margin-top: 36px; padding: 24px 26px; border: 1px solid var(--mint-300); border-radius: 14px; background: var(--mint-50); }
.lesson-feedback-cta h2 { margin: 0 0 8px; font-size: 22px; }
.lesson-feedback-cta p { margin: 0 0 16px; }
.lesson-finish { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--line); }
.lesson-paywall-inline .classroom-actions { justify-content: center; }
.ai-video-classroom .lesson-paywall-inline h2 { text-wrap: balance; }
.lesson-paywall-inline .inline-strong { display: inline; margin: 0; font-family: inherit; font-size: inherit; }
.tool-actions .btn { width: 100%; margin-top: 10px; padding-inline: 10px; }
.mobile-action-slot { flex: 1; display: flex; }
.mobile-action-slot .btn { flex: 1; min-height: 46px; }

@media (max-width: 1040px) {
  .lesson-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .classroom-hero { padding: 36px 22px 4px; grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .classroom-poster { order: -1; width: min(100%, 300px); margin: 0 auto; }
  /* 手機版上方列排在單元內容前面，不用絕對定位（避免疊到頁首） */
  .ai-video-classroom .lesson-view { padding-top: 0; }
  .ai-video-classroom .mobile-lesson-top { position: static; margin: 18px 21px 0; }
  .ai-video-classroom .lesson-article { padding-top: 26px; }
  .ai-video-classroom .lesson-tools { display: none; }
}

@media (max-width: 620px) {
  .classroom-hero { padding: 36px 16px 0; }
  .classroom-hero h1 { font-size: 40px; }
  .classroom-status { padding: 20px 18px; }
  .classroom-actions { flex-direction: column; align-items: stretch; }
  .ai-video-classroom .roadmap { padding-top: 44px; }
  .classroom-poster { width: min(100%, 190px); padding: 5px; border-radius: 12px; box-shadow: 6px 6px 0 #c8ff00, 0 14px 32px rgba(7, 17, 15, .18); }
  .lesson-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  .lesson-thumb-num { left: 9px; font-size: 28px; }
  .lesson-thumb-chip { right: 6px; top: 6px; padding: 3px 7px; font-size: 10.5px; }
  .lesson-card-title { margin-top: 7px; font-size: 14.5px; }
  .card-part-label strong { font-size: 22px; }
  .ai-video-classroom .lesson-article h1 { font-size: 30px; }
  .video-frame { border-radius: 8px; }
  .video-placeholder { padding: 20px 16px; }
  .video-placeholder-icon { width: 44px; height: 44px; font-size: 16px; }
  .lesson-deliverable { padding: 14px 16px; }
  .lesson-deliverable strong { font-size: 17px; }
  .lesson-finish { flex-direction: column; }
  .lesson-finish .btn,
  .download-list .btn { width: 100%; }
}
