/*
 * course-image-viewer.css —— 课程内示例图 Lightbox 样式
 * 课程反馈修复 r1（2026-11-16）
 * 所有类名统一 course-image-viewer- 前缀，不污染无关页面样式。
 */
.course-image-viewer-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 24px;
  background: rgba(8, 14, 28, .82);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.course-image-viewer-dialog {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: min(960px, 100%);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  border: 1px solid rgba(160, 190, 240, .35);
  border-radius: 14px;
  background: #0b152c;
  color: #eaf2ff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
  font-family: inherit;
}

.course-image-viewer-header {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: #12224a;
  border-bottom: 1px solid rgba(160, 190, 240, .22);
}

.course-image-viewer-title {
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.course-image-viewer-close {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(160, 190, 240, .5);
  border-radius: 10px;
  background: rgba(255, 255, 255, .08);
  color: #eaf2ff;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
.course-image-viewer-close:hover { background: rgba(255, 255, 255, .16); }
.course-image-viewer-close:focus-visible { outline: 2px solid #67e8f9; outline-offset: 2px; }

.course-image-viewer-stage {
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: auto;
  background: #070d1c;
}

.course-image-viewer-image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 220px);
  max-height: calc(100dvh - 220px);
  width: auto;
  height: auto;
  border-radius: 8px;
  background: #fff;
}

.course-image-viewer-status {
  box-sizing: border-box;
  min-height: 20px;
  padding: 6px 16px;
  font-size: 12px;
  line-height: 1.5;
  color: #a9bde6;
}
.course-image-viewer-status.is-error { color: #ffd08a; }

.course-image-viewer-footer {
  box-sizing: border-box;
  display: flex;
  justify-content: flex-end;
  padding: 10px 16px 14px;
}

.course-image-viewer-original {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(34, 211, 238, .53);
  border-radius: 10px;
  background: rgba(34, 211, 238, .12);
  color: #a6f2ff;
  font-size: 14px;
  text-decoration: none;
  touch-action: manipulation;
}
.course-image-viewer-original:hover { background: rgba(34, 211, 238, .22); }
.course-image-viewer-original:focus-visible { outline: 2px solid #67e8f9; outline-offset: 2px; }

/* 浅色主题：仍保持深色代码块式查看器，但用描边与页面区分。 */
html[data-theme="light"] .course-image-viewer-overlay { background: rgba(226, 232, 240, .86); }
html[data-theme="light"] .course-image-viewer-dialog { border-color: rgba(29, 78, 216, .67); }

/* 深色主题：略微提亮描边以增强代码块边界。 */
html[data-theme="dark"] .course-image-viewer-dialog { border-color: rgba(34, 211, 238, .53); }

/* 触屏窄屏：全屏化、加大按钮、保证可滚动。 */
@media (max-width: 640px) {
  .course-image-viewer-overlay { padding: 0; }
  .course-image-viewer-dialog {
    width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  .course-image-viewer-image {
    max-height: calc(100vh - 200px);
    max-height: calc(100dvh - 200px);
  }
}
