/* ========================================================================
   可视化手持遥测仪 · 设备端原型样式
   屏幕：2.88 寸触摸屏 · 480 × 640（竖屏）
   ------------------------------------------------------------------------
   说明：
   - .device-frame  模拟手持设备外壳（工业仪表风格），把屏幕画布包裹起来
   - .device-screen 屏幕画布，固定 480×640，所有页面内容在此内部布局
   - 原型展示时，屏幕会等比缩放以适应浏览器窗口；真实像素基准始终是 480×640
   ======================================================================== */

:root {
  /* 画布基准尺寸（真实屏幕分辨率） */
  --screen-w: 480px;
  --screen-h: 640px;
  /* 设备外壳参数 */
  --frame-border: 18px;
  --frame-radius: 28px;
  --frame-bg: #2b2f36;
  --frame-edge: #1c1f24;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ---------- 设备外壳 ---------- */
.device-frame {
  position: relative;
  width: calc(var(--screen-w) + var(--frame-border) * 2);
  height: calc(var(--screen-h) + var(--frame-border) * 2);
  padding: var(--frame-border);
  background: linear-gradient(160deg, var(--frame-bg), var(--frame-edge));
  border-radius: var(--frame-radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* 屏幕区域 */
.device-screen {
  position: relative;
  width: var(--screen-w);
  height: var(--screen-h);
  overflow: hidden;
  border-radius: 6px;
  background: #0f1419;
  color: #e6edf3;
}

/* ---------- 等比缩放适配窗口 ---------- */
/* 当窗口小于设备尺寸时，整体缩放；保持 480×640 的设计基准不变 */
@media (max-width: 540px), (max-height: 720px) {
  .device-frame {
    transform: scale(0.62);
    transform-origin: center center;
  }
}

/* ---------- 通用屏幕内布局辅助 ---------- */
.screen-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ---------- 裸屏模式（配合实物展示页，去除模拟外壳）---------- */
/* 触发：展示页 iframe 在 onload 时给 iframe.contentDocument.documentElement 加 .bare 类 */
html.bare body {
  background: transparent;
  display: block;
  min-height: auto;
}
html.bare .device-frame {
  padding: 0;
  width: var(--screen-w);
  height: var(--screen-h);
  background: none;
  border-radius: 0;
  box-shadow: none;
  transform: none !important;
}
html.bare .device-screen {
  border-radius: 0;
}
