/* 大屏播放页 —— 极简中性风 */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #303236; /* 中灰底，无内容时的兜底 */
  font-family: "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.stage { position: fixed; inset: 0; display: grid; gap: 0; }

/* 每个播放区域：绝对定位坐标由 JS 按 layout.regions 写入 */
.region { position: relative; overflow: hidden; background: #303236; }
.region .frame { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }

/* 毛玻璃背景：同一张图 cover + 模糊 + 压暗（不裁切主体，只垫在底下） */
.region .frame::before {
  content: ""; position: absolute; inset: -8%;
  background: var(--bg, #303236) center/cover no-repeat;
  filter: blur(30px) brightness(0.75);
  transform: scale(1.05);
}
/* 额外的一层压暗，让前景图更突出 */
.region .frame::after {
  content: ""; position: absolute; inset: 0; background: rgba(48, 50, 54, 0.25);
}

/* 前景图：完整显示（contain，不裁切）；载入后淡入 0.6s */
.region img {
  position: relative; max-width: 100%; max-height: 100%;
  object-fit: contain; z-index: 2;
  opacity: 0; transition: opacity 0.6s ease;
}
.region img.loaded { opacity: 1; }

/* 铺满模式（cover）：图占满区域裁掉超出部分；此时隐藏毛玻璃衬底，避免双层 */
.region .frame.mode-cover::before,
.region .frame.mode-cover::after { display: none; }
.region .frame.mode-cover img { width: 100%; height: 100%; max-width: none; max-height: none; }

/* 文字内容页：整屏 markdown，自动缩放适配 */
.region .frame.is-text::before,
.region .frame.is-text::after { display: none; }
.region .text-page {
  position: relative; z-index: 2;
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 3%;
  transform-origin: center center;
}
.region .text-page .text-title {
  color: #fff; font-size: 2.6vmin; font-weight: 700;
  letter-spacing: 1px; margin-bottom: 2.4vmin; text-align: center;
}
.region .text-page .text-body {
  color: #e6e8ea; max-width: 100%;
  font-size: 1.9vmin; line-height: 1.7;
}
.text-body h1, .text-body h2, .text-body h3, .text-body h4 {
  color: #fff; margin: 1.2em 0 0.5em; line-height: 1.3;
}
.text-body h1 { font-size: 2.4em; }
.text-body h2 { font-size: 1.8em; }
.text-body h3 { font-size: 1.4em; }
.text-body h4 { font-size: 1.15em; }
.text-body p { margin: 0.5em 0; }
.text-body ul, .text-body ol { margin: 0.5em 0 0.5em 1.6em; }
.text-body li { margin: 0.2em 0; }
.text-body strong { color: #fff; }
.text-body em { color: #cdd6e0; }
.text-body code {
  background: rgba(255, 255, 255, 0.12); border-radius: 4px; padding: 0.1em 0.35em;
  font-family: Consolas, Menlo, monospace; font-size: 0.9em;
}
.text-body pre {
  background: rgba(0, 0, 0, 0.45); border-radius: 8px; padding: 1em; margin: 0.8em 0;
  overflow: hidden; white-space: pre-wrap; word-break: break-word;
}
.text-body pre code { background: none; padding: 0; }
.text-body blockquote {
  border-left: 4px solid #4a6fa5; margin: 0.8em 0; padding: 0.3em 1em;
  color: #c2ccd8; background: rgba(255, 255, 255, 0.06); border-radius: 0 6px 6px 0;
}
.text-body table {
  border-collapse: collapse; margin: 0.8em auto; min-width: 40%;
}
.text-body th, .text-body td {
  border: 1px solid rgba(255, 255, 255, 0.25); padding: 0.35em 0.9em; text-align: left;
}
.text-body th { background: rgba(255, 255, 255, 0.1); color: #fff; }
.text-body a { color: #6cb2ff; text-decoration: none; }
.text-body hr { border: none; border-top: 1px solid rgba(255, 255, 255, 0.2); margin: 1em 0; }

/* 左下角标题：半透明底 + 模糊 */
.region .caption {
  position: absolute; left: 24px; bottom: 20px; z-index: 3; max-width: 70%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 8px 14px; border-radius: 6px;
  color: #fff; line-height: 1.4;
}
.region .caption .title { font-size: 22px; font-weight: 600; }
.region .caption .desc { font-size: 16px; opacity: 0.9; margin-top: 2px; }

/* 右下角小胶囊：时间 + 页码 */
.clock {
  position: fixed; right: 28px; bottom: 20px; z-index: 10;
  color: rgba(255, 255, 255, 0.8); font-size: 18px; letter-spacing: 1px;
  background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  padding: 6px 14px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

/* 左上角可选 logo */
.logo {
  position: fixed; left: 28px; top: 20px; z-index: 10;
  color: rgba(255, 255, 255, 0.85); font-size: 18px; font-weight: 600;
  background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  padding: 6px 14px; border-radius: 6px;
}
