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

/* 1. 全屏铺满，外围仅留 20px 边距一圈 */
body {
  background-color: #121212;
  color: #fff;
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  padding: 20px;          /* 外围留出的黑框宽度，想更窄可以改成 10px */
  overflow: hidden;        /* 彻底消除浏览器滚动条 */
}

/* 2. 主容器：无限制撑满 body */
.tv-container {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  background: #2b2b2b;
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  width: 100%;            /* 撑满宽度 */
  height: 100%;           /* 撑满高度 */
}

/* 3. 电视屏幕：吃满绝大部分空间 */
.tv-screen {
  position: relative;
  flex: 1;                /* 自动挤占右侧遥控器之外的所有剩余宽度 */
  height: 100%;           /* 垂直方向完全撑满 */
  background-color: #000;
  border: 16px solid #4a3b32; /* 木纹外框 */
  border-radius: 20px;
  overflow: hidden;
}

/* 确保 YouTube iframe 填充屏幕 */
#player, #player iframe {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
}

/* 4. 雪花屏 Canvas */
#noiseCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease;
}

#noiseCanvas.active {
  opacity: 1;
}

/* 关机黑屏遮罩 */
.power-off-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 10;
  display: block;
}

.tv-screen.powered-on .power-off-overlay {
  display: none;
}

/* 5. 遥控器 UI：保持右侧固定紧凑宽度 */
.remote-control {
  width: 120px;
  flex-shrink: 0;         /* 不允许拉伸变形 */
  background: #333;
  border-radius: 16px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  border: 2px solid #555;
  box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.5);
}

.remote-title {
  font-size: 11px;
  letter-spacing: 2px;
  color: #aaa;
  font-weight: bold;
}

.remote-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.btn {
  flex: 1;
  padding: 10px 0;
  background: #555;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 11px;
  box-shadow: 0 4px #222;
  transition: all 0.1s ease;
}

.btn:active {
  box-shadow: 0 1px #222;
  transform: translateY(3px);
}

.btn-power {
  background: #e74c3c;
  width: 100%;
}

.btn-mute {
  background: #f39c12;
  width: 100%;
}
