:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

html,
body {
  margin: 0;
  height: 100%;
  background: #000;
  color: #fff;
}

.app {
  display: grid;
  grid-template-rows: 1fr auto;
  height: 100dvh; /* dvh 跟随 Safari 地址栏伸缩，100vh 在 iPhone 上会被地址栏挡住 */
  padding-top: env(safe-area-inset-top);
  box-sizing: border-box;
}

.preview {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

/* 保持原始画面比例、允许黑边（计划第一节），S4 的关键点坐标依赖这一点 */
#preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}

.status {
  margin: 0;
  min-height: 1.4em;
  font-size: 15px;
  text-align: center;
}

.toggle {
  min-width: 120px;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 24px;
  background: #fff;
  color: #000;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* 防止 iOS 双击缩放 */
}

.toggle:active {
  opacity: 0.7;
}

.toggle:focus-visible {
  outline: 2px solid #ffd60a;
  outline-offset: 3px;
}
