/* ============================================================
 *  課程影片（Bunny Stream）— brand v.02 atelier 樣式
 *  酒紅 #641322 · 香檳 #B8965A · 象牙 #F7F2E8 · 瓷白 #fbfaf6
 * ============================================================ */

.view-courses { padding: 8px 4px 48px; }
.view-courses .view-sub { color: #6b5f52; font-size: 13px; margin: 4px 0 0; }

.courses-loading,
.courses-empty {
  padding: 48px 24px;
  text-align: center;
  color: #8a7d6d;
  font-size: 14px;
}

.courses-plan-hint {
  margin: 14px 0 22px;
  padding: 12px 16px;
  background: #fbfaf6;
  border: 1px solid rgba(184, 150, 90, 0.45);
  border-left: 3px solid #B8965A;
  color: #5a4a2e;
  font-size: 13px;
  line-height: 1.6;
}

.course-section { margin-bottom: 34px; }
.course-section-title {
  font-family: 'Cormorant Garamond', 'Noto Serif TC', serif;
  font-size: 26px;
  font-weight: 600;
  color: #641322;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(184, 150, 90, 0.4);
}

.course-lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.course-lesson-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 16px;
  background: #F7F2E8;
  border: 1px solid rgba(100, 19, 34, 0.14);
  border-radius: 0;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  font: inherit;
}
.course-lesson-card:hover {
  transform: translateY(-2px);
  border-color: rgba(100, 19, 34, 0.4);
  box-shadow: 0 6px 18px rgba(100, 19, 34, 0.1);
}

.course-lesson-play {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: #641322;
  border-radius: 999px;
}
.course-lesson-play svg { width: 18px; height: 18px; }

.course-lesson-lockicon {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  color: #8a7d6d;
  background: rgba(138, 125, 109, 0.14);
  border-radius: 999px;
}
.course-lesson-lockicon svg { width: 18px; height: 18px; }

.course-lesson-body { flex: 1 1 auto; min-width: 0; }
.course-lesson-title {
  font-weight: 600;
  color: #2b211a;
  font-size: 15px;
  line-height: 1.4;
}
.course-lesson-meta {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 6px;
}
.course-lesson-module,
.course-lesson-dur {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #8a7d6d;
  letter-spacing: 0.03em;
}
.course-lesson-desc {
  margin-top: 8px;
  font-size: 12.5px;
  color: #6b5f52;
  line-height: 1.5;
}
.course-lesson-locklabel {
  margin-top: 8px;
  font-size: 12px;
  color: #641322;
  font-weight: 600;
}

.course-lesson-locked { background: #f3efe6; opacity: 0.92; }
.course-lesson-locked:hover { transform: none; box-shadow: none; border-color: rgba(184, 150, 90, 0.5); }

/* ── 播放 modal ── */
.course-player-overlay {
  position: fixed; inset: 0;
  background: rgba(26, 18, 14, 0.86);
  display: flex; align-items: center; justify-content: center;
  z-index: 10001;
  padding: 24px;
}
.course-player-modal {
  position: relative;
  width: 100%;
  max-width: 960px;
  background: #1a120e;
  border: 1px solid rgba(184, 150, 90, 0.4);
}
.course-player-close {
  position: absolute;
  top: -14px; right: -14px;
  width: 40px; height: 40px;
  border-radius: 999px;
  background: #641322;
  color: #fff;
  border: 2px solid #F7F2E8;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.course-player-close svg { width: 18px; height: 18px; }
.course-player-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
}
.course-player-frame iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.course-player-loading,
.course-player-error {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #d9cdb8; font-size: 14px; text-align: center; padding: 24px;
}
.course-player-error { color: #e8b4bd; }

/* ── Admin 課程影片管理 ── */
.admin-courses-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.admin-courses-hint { color: #6b5f52; font-size: 12.5px; margin: 0; flex: 1 1 260px; }
.admin-courses-actions { display: flex; gap: 8px; }

.admin-courses-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-courses-table th,
.admin-courses-table td {
  border-bottom: 1px solid rgba(184, 150, 90, 0.3);
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
}
.admin-courses-table th {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; letter-spacing: 0.04em;
  color: #8a7d6d; text-transform: uppercase;
}
.admin-courses-guid { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: #6b5f52; word-break: break-all; }
.admin-courses-guid.admin-courses-warn { color: #a8321f; }
.btn-mini {
  font-size: 12px; padding: 4px 10px;
  border: 1px solid rgba(100, 19, 34, 0.35);
  background: #F7F2E8; color: #641322; cursor: pointer;
}
.btn-mini:hover { background: #641322; color: #fff; }
.btn-mini-danger { border-color: rgba(168, 50, 31, 0.4); color: #a8321f; }
.btn-mini-danger:hover { background: #a8321f; color: #fff; }

.courses-admin-overlay {
  position: fixed; inset: 0;
  background: rgba(26, 18, 14, 0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 10002; padding: 24px;
}
.courses-admin-modal {
  width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  background: #fbfaf6;
  border: 1px solid rgba(184, 150, 90, 0.5);
  padding: 24px;
}
.courses-admin-modal h3 {
  font-family: 'Cormorant Garamond', 'Noto Serif TC', serif;
  color: #641322; margin: 0 0 16px; font-size: 22px;
}
.courses-admin-modal label {
  display: block; margin-bottom: 12px;
  font-size: 12.5px; color: #5a4a2e; font-weight: 600;
}
.courses-admin-modal input,
.courses-admin-modal select,
.courses-admin-modal textarea {
  display: block; width: 100%; margin-top: 4px;
  padding: 8px 10px; font: inherit; font-weight: 400;
  border: 1px solid rgba(184, 150, 90, 0.5);
  background: #fff; color: #2b211a;
}
.courses-admin-modal input[readonly] { background: #efe9dd; color: #8a7d6d; }
.courses-admin-row2 { display: flex; gap: 10px; }
.courses-admin-row2 label { flex: 1 1 0; }
.courses-admin-formbar {
  display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px;
}

@media (max-width: 640px) {
  .course-lesson-grid { grid-template-columns: 1fr; }
  .course-section-title { font-size: 22px; }
  .course-player-overlay { padding: 12px; }
  .course-player-close { top: -10px; right: -10px; width: 36px; height: 36px; }
  .admin-courses-bar { flex-direction: column; align-items: stretch; }
  .courses-admin-row2 { flex-direction: column; gap: 0; }
}
