* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  /* 使用 100dvh 解决移动端浏览器地址栏导致的底部遮挡问题 */
  height: 100dvh; 
  overflow: hidden;
  background: #000;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #fff;
  /* 禁用移动端点击高亮 */
  -webkit-tap-highlight-color: transparent; 
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* 视频铺满容器 */
#video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: 1;
}

/* Canvas 与视频重叠 */
#canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* 状态栏与调节控件 */
#status-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); /* 适配 iPhone 底部黑条 */
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8) 40%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  pointer-events: none;
}

#status-bar > * {
  pointer-events: auto;
}

#status-text {
  color: #aaffaa;
  font-weight: 500;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

#controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

#controls label {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #ddd;
  font-size: 11px;
}

#controls input[type="range"] {
  width: 60px;
  accent-color: #4caf50;
}

#controls span {
  min-width: 28px;
  text-align: center;
  color: #fff;
  font-variant-numeric: tabular-nums;
}