/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background-color: #000;
  font-family: "Microsoft YaHei", Arial, sans-serif;
}

/* 媒体容器：层级基准 */
.media-container {
  position: relative;
  width: 100%;
  height: 100%;
}

/* iframe（底层：z-index=1） */
#targetIframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  z-index: 1;
  display: none;
}

/* 视频/图片（中层：z-index=10） */
#fullscreen-video,
#fullscreen-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 10;
  display: none;
}

/* 图片：先慢后快过渡 */
#fullscreen-image {
  transition: opacity var(--fade-duration, 4s) cubic-bezier(0.25, 0, 0.8, 0.7);
}

/* 图片透明类 */
.image-fade-out {
  opacity: 0;
}

/* 跳过按钮（顶层：z-index=100） */
.skip-button {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 100;
  background-color: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 6px 12px;
  font-size: 14px;
  display: none;
}

.skip-button:hover:not(:disabled) {
  background-color: rgba(0, 0, 0, 0.9);
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.8);
}

.skip-button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  background-color: rgba(0, 0, 0, 0.3);
}

/* 加载提示（z-index=50） */
.loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  color: #fff;
  text-align: center;
}

.loading-indicator i {
  font-size: 36px;
  margin-bottom: 8px;
  animation: spin 1.5s linear infinite;
}

.loading-indicator p {
  font-size: 16px;
}

/* 错误提示（z-index=60） */
.error-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 60;
  color: #fff;
  text-align: center;
  padding: 24px;
  background-color: rgba(239, 68, 68, 0.4);
  border-radius: 8px;
  display: none;
  max-width: 80%;
}

.error-message i {
  font-size: 36px;
  margin-bottom: 12px;
}

.error-message p {
  font-size: 16px;
  line-height: 1.5;
}

/* 加载旋转动画 */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}