:root { font-family: Inter, "Microsoft YaHei", system-ui, sans-serif; color: #edf4fb; background: #07111c; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 15% 0, #18334a, #07111c 44%); }
main { width: min(1180px, calc(100% - 32px)); margin: 24px auto; }
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
h1 { margin: 0; font-size: 24px; }
#connection { padding: 7px 11px; border-radius: 99px; background: #15283a; }
.connection-badges { display: flex; gap: 8px; align-items: center; }
#connectionType { padding: 7px 11px; border: 1px solid #294158; border-radius: 99px; color: #9bb1c4; }
#connectionType.wan { color: #ffcb6b; }
#connectionType.lan { color: #79d8ff; }
.wan-login { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; margin-bottom: 14px; padding: 14px; border: 1px solid #294158; border-radius: 12px; background: #0c1b29; }
.wan-login[hidden] { display: none; }
.wan-login input { min-width: 0; padding: 10px; border: 1px solid #35526b; border-radius: 8px; color: #edf4fb; background: #07111c; }
.online { color: #67e8a5; }
.initializing { color: #ffd166; }
.offline { color: #ff8293; }
.console-layout { display: grid; grid-template-columns: minmax(0, 72fr) minmax(280px, 28fr); min-height: 680px; overflow: hidden; border: 1px solid #294158; border-radius: 18px; background: #02070d; box-shadow: 0 20px 60px #0007; }
.video-panel { display: grid; place-items: center; min-width: 0; padding: 24px; overflow: hidden; background: linear-gradient(135deg, #07121e, #02070d); }
.video-frame { position: relative; width: min(100%, 390px); aspect-ratio: 9 / 16; overflow: hidden; border-radius: 14px; background: #000; box-shadow: 0 14px 40px #000a; }
.video-frame img { position: absolute; top: 50%; left: 50%; width: auto; height: 100%; object-fit: contain; transform: translate(-50%, -50%) rotate(var(--video-rotation, 90deg)); transform-origin: center; }
.video-frame canvas { width: 100%; height: 100%; object-fit: contain; background: #000; }
.device-panel { display: grid; grid-template-rows: minmax(250px, 42%) 1fr; border-left: 1px solid #24394d; background: #0c1b29; }
.pose-panel { display: grid; place-items: center; padding: 28px; border-bottom: 1px solid #24394d; perspective: 700px; }
.phone { position: relative; width: 96px; height: 192px; transition: transform .25s ease; transform-style: preserve-3d; }
.phone-face, .phone-edge { position: absolute; backface-visibility: hidden; transform-style: preserve-3d; }
.phone-face { inset: 0; overflow: hidden; border: 4px solid #7e9ab2; border-radius: 17px; box-shadow: 12px 16px 25px #0009; }
.phone-front { background: #04090e; transform: translateZ(6px); }
.screen { position: absolute; inset: 5px; overflow: hidden; border-radius: 11px; background: linear-gradient(150deg, #244968, #081522 68%); }
.screen::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, #ffffff12 50%, transparent 65%); }
.front-camera { position: relative; z-index: 1; width: 8px; height: 8px; margin: 7px auto; border-radius: 50%; background: #000; box-shadow: 0 0 0 2px #1f3546; }
.phone-back { display: flex; align-items: flex-end; justify-content: center; padding-bottom: 18px; color: #b9cad8; background: linear-gradient(145deg, #3b5265, #162633); transform: rotateY(180deg) translateZ(6px); }
.phone-back span { font-size: 10px; letter-spacing: 1px; opacity: .65; }
.rear-camera-module { position: absolute; top: 12px; left: 11px; display: grid; grid-template-columns: repeat(2, 12px); gap: 5px; padding: 7px; border-radius: 9px; background: #071018; box-shadow: 0 2px 8px #0008; }
.rear-camera-module i { width: 12px; height: 12px; border: 2px solid #526e83; border-radius: 50%; background: #000; }
.rear-camera-module i:last-child { grid-column: 1 / -1; justify-self: center; }
.phone-edge { background: #688398; }
.phone-edge-left, .phone-edge-right { top: 9px; width: 12px; height: 174px; }
.phone-edge-left { left: -6px; transform: rotateY(-90deg); }
.phone-edge-right { right: -6px; transform: rotateY(90deg); }
.phone-edge-top, .phone-edge-bottom { left: 9px; width: 78px; height: 12px; }
.phone-edge-top { top: -6px; transform: rotateX(90deg); }
.phone-edge-bottom { bottom: -6px; transform: rotateX(-90deg); }
.controls-panel { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 22px; overflow: auto; }
.status-grid { width: 100%; margin: 0 0 4px; }
.status-grid div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #21394e; }
dt { color: #7891a8; }
dd { margin: 0; font-weight: 700; }
button, .file { width: 100%; padding: 10px 14px; border: 1px solid #35526b; border-radius: 10px; color: #dfeaf4; background: #102234; cursor: pointer; font-weight: 650; text-align: center; }
button:hover, .file:hover, .segmented .active { color: #07111c; background: #66d4ff; border-color: #66d4ff; }
button:disabled { opacity: .4; cursor: default; }
.segmented { display: flex; width: 100%; }
.segmented button { border-radius: 0; }
.segmented button:first-child { border-radius: 10px 0 0 10px; }
.segmented button:last-child { border-radius: 0 10px 10px 0; }
.file input { display: none; }
.switch { display: flex; align-items: center; gap: 8px; color: #a9bbca; }
.switch input { accent-color: #66d4ff; }
#message { margin: 4px 0 0; color: #8da3b7; line-height: 1.45; }
@media (max-width: 760px) {
  .console-layout { grid-template-columns: 1fr; }
  .video-panel { min-height: 620px; }
  .device-panel { grid-template-rows: 280px auto; border-left: 0; border-top: 1px solid #24394d; }
}
