* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: #101418;
  color: #e8eef6;
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid #263142;
  background: #151b22;
  padding: 20px 16px;
}

.brand {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 18px;
}

.device {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #334255;
  background: #1d2630;
  color: #e8eef6;
  padding: 12px 14px;
  border-radius: 6px;
  cursor: default;
}

.device-name {
  font-size: 15px;
  font-weight: 700;
}

.device-state {
  color: #ffcf66;
  font-size: 13px;
}

.device-state.online {
  color: #5ce19a;
}

.viewer {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  padding: 18px 22px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 14px;
}

.title {
  font-size: 22px;
  font-weight: 700;
}

.subtitle {
  margin-top: 4px;
  color: #9cacbf;
  font-size: 14px;
}

.metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.metrics span {
  min-width: 78px;
  text-align: center;
  border: 1px solid #334255;
  border-radius: 6px;
  padding: 7px 10px;
  background: #17202a;
  color: #dce7f3;
  font-size: 13px;
}

.video-stage {
  position: relative;
  min-height: 360px;
  border: 1px solid #263142;
  background: #05070a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.video-stage canvas,
.video-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.video-stage canvas.visible,
.video-stage img.visible {
  display: block;
}

.empty {
  position: absolute;
  color: #7f8da0;
  font-size: 15px;
  text-align: center;
  padding: 0 18px;
}

.empty.hidden {
  display: none;
}

.footer-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #9cacbf;
  font-size: 13px;
  padding-top: 12px;
}

@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid #263142;
  }

  .toolbar,
  .footer-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .metrics {
    justify-content: flex-start;
  }
}
