/* base */

* {
  padding: 0;
  margin: 0;
}

html,
body {
  height: 100%;
}

/* container */

.container {
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: #f0f8ff1f;
}

/* container = header + body */

.header {
  background-color: rgba(129, 211, 248, 1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  height: 40px;
}

.body {
  height: 100%;
  overflow: hidden;
  border-left: 2px solid rgba(129, 211, 248, 1);
  border-right: 2px solid rgba(129, 211, 248, 1);
  border-bottom: 3px solid rgba(129, 211, 248, 1);
}

/* header = logo + menus + buttons + icons */

.header .logo {
  width: 40px;
  height: 100%;
}

.header .logo img {
  width: 100%;
  height: 100%;
}

.header .menus {
  flex: 1 0 auto;
}

.header .menus .menu-item {
  padding: 5px 15px;
  font-size: 19px;
  line-height: 30px;
  display: inline-block;
  color: #8c8c8c;
  font-weight: 800;
  user-select: none;
}

.header .menus .menu-item .submenu {
  position: absolute;
  top: 2px;
  z-index: 100;
  padding: 5px 15px;
  margin-left: -15px;
  background-color: rgba(129, 211, 248, 1);
  box-shadow: grey 2px 2px 15px 1px;
}

.header .menus .menu-item .submenu dd {
  height: 40px;
}

.header .menus .menu-active {
  color: blue;
}

.header .buttons {
  flex: 1 0 auto;
  text-align: center;
}

.header .buttons button {
  border-radius: 2px;
  height: 32px;
  line-height: 32px;
  padding: 0 15px;
  font-weight: 500;
  border: 1px solid white;
}

.header .buttons button.btn-otdr-table {
  background-color: #1e9fff;
  padding: 0 10px;
}

.header .buttons button.btn-start {
  background-color: rgba(103, 198, 113, 1);
}

.header .buttons button.btn-stop {
  background-color: red;
}

.header .buttons button.btn-hammer {
  font-size: 20px;
  padding: 0 10px;
  color: #0014ff;
  font-weight: 600;
  background-color: aliceblue;
  width: 50px;
  background-image: url(../img/hammer.png);
  background-size: auto 80%;
  background-repeat: no-repeat;
  background-position: center;
}

.header .buttons button.btn-hammer-run {
  background-image: none;
}

.header .icons {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  flex: 0 0 100px;
  margin-right: 5px;
  align-items: center;
}

.header .icons .icon {
  font-size: 32px;
  text-align: center;
  padding-top: 4px;
}

.header .icons .ping {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: yellow;
  width: 30px;
  padding-top: 0;
  align-items: center;
}

/* body = page-1 + page-2 + page-0 */

.page {
  height: 100%;
}

.page .mainbox {
  display: grid;
  height: 100%;
}

/* page-1 = mainbox(chart + controls + waterfall + channel) */

.page-1 .mainbox {
  grid-template-columns: 80% 20%;
  grid-template-rows: 62% 38%;
}

.page-1 .chart {
  position: relative;
}

.page-1 .chart .wave,
.page-1 .chart .channel {
  width: 100%;
  height: 100%;
}

.page-1 .chart .coil_btns {
  position: absolute;
  right: 72px;
  top: 0px;
  display: flex;
  align-items: center;
}

.page-1 .chart .ofck_btns {
  position: absolute;
  left: 3px;
  bottom: 3px;
}

.page-1 .chart .coil_btns span {
  font-size: x-large;
}

.page-1 .controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding-bottom: 5px;
}

.page-1 .controls .control {
  display: flex;
  justify-content: space-around;
  margin: 1px 0;
}

.page-1 .controls .control .value {
  width: 100%;
  text-align: center;
  margin-left: 2px;
  line-height: 30px;
  background-color: #d3e6f6;
  border-radius: 3px;
  border: 0;
  height: 30px;
}

.page-1 .controls .control button {
  width: 70px;
}

.page-1 .controls .control select {
  flex: 1 0 auto;
  margin-left: 2px;
  background-color: #d3e6f6;
  border-radius: 3px;
  border: 0;
  height: 30px;
  text-align: center;
}

.page-1 .controls .events-table {
  flex: 1 0 100px;
  overflow: auto;
  align-items: flex-start;
  background-color: aliceblue;
}

.page-1 .controls .upload {
  background-color: seashell;
}

.page-1 .controls .upload input[type="file"] {
  display: none;
}

.page-1 .controls .upload button {
  min-width: 52px;
  margin-left: 0;
}

.page-1 .events-table table {
  margin: 2px 0;
  text-align: center;
}

.page-1 .events-table table th {
  text-align: center;
  padding: 0px 10px;
  background-color: antiquewhite;
}

.page-1 .events-table table td {
  text-align: center;
  padding: 3px 10px;
}

.page-1 .events-table tbody {
  overflow: auto;
}

.page-1 .events-table tr.row-best {
  background-color: greenyellow;
}

.page-1 .events-table tr.row-active {
  background-color: #ffb800;
}

.page-1 .time_label {
  display: flex;
  width: 18px;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 12px;
  color: rgb(141, 143, 150);
  /* padding-right: 1px; */
}

.page-1 .right_pad {
  width: 17px;
  /* padding-left: 1px; */
  flex: 0 0 auto;
}

.page-1 .waterfall {
  display: flex;
  background-color: aliceblue;
}

.page-1 .waterfall canvas {
  width: 100%;
  height: 100%;
}

/* page-2 = mainbox(global + controls) */

.page-2 .mainbox {
  grid-template-columns: 80% 20%;
}

.page-2 .controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  background: aliceblue;
}

.page-2 .controls .control {
  display: flex;
  justify-content: space-between;
  margin: 1px 0;
}

.page-2 .controls .control-pulse-width button,
.page-2 .controls .control-max-range button {
  width: 70px;
}

.page-2 .controls .control select {
  flex: 1 0 auto;
  margin-left: 2px;
  background-color: #d3e6f6;
  border-radius: 3px;
  border: 0;
  height: 30px;
  text-align: center;
}

.page-2 .controls .channels {
  flex-direction: column;
}

.page-2 .channels .buttons {
  display: grid;
  grid-template-columns: 42% 42%;
  grid-column-gap: 16%;
  grid-row-gap: 5px;
  width: 84%;
  margin: 10px auto;
}

.page-2 .channels .buttons button {
  height: 26px;
  background-color: #c7e2f7;
  border-radius: 3px;
  border: 0;
}

.page-2 .channels button.channel-active {
  background-color: darkorange;
}

/* page-3 = mainbox(otdr + controls) */

.page-3 .mainbox {
  grid-template-columns: 80% 20%;
}

.page-3 .ground {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.page-3 .ground .coil_btns {
  position: absolute;
  right: 30px;
  top: 2px;
  display: flex;
  gap: 5px;
  align-items: center;
  cursor: pointer;
}

.page-3 .otdr {
  flex: 1 1 auto;
}

.page-3 .events-table {
  height: 25%;
  flex: 0 0 auto;
  overflow: auto;
}

.page-3 .events-table table {
  background-color: beige;
  margin: 0;
}

.page-3 .events-table tr.row-active {
  background-color: #ffb800;
}

.page-3 .controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  background: aliceblue;
}

.page-3 .controls .control {
  display: flex;
}

.page-3 .status {
  margin-bottom: 1px;
  justify-content: space-between;
  background-color: antiquewhite;
}

.page-3 .led-box {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 50%;
}

.page-3 .led-box .led-red {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin: 2px auto;
}

.page-3 .led-box .led-off {
  background-color: rgb(255 255 255 / 50%);
  box-shadow: inset #ff000080 0px 0px 8px 10px;
}

.page-3 .led-box .led-on {
  background-color: #f00;
  box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #441313 0 -1px 9px, rgba(255, 0, 0, 0.5) 0 2px 12px;
  animation: blinkRed 0.75s infinite;
}

@keyframes blinkRed {
  from {
    background-color: #f00;
  }

  50% {
    background-color: #a00;
    box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #441313 0 -1px 9px, rgba(255, 0, 0, 0.5) 0 2px 0;
  }

  to {
    background-color: #f00;
  }
}

.page-3 .led-box button {
  padding: 0 10px;
  margin: 1px 0;
}

.page-3 .btn-box {
  display: flex;
  width: 50%;
  justify-content: center;
  align-items: center;
}

.page-3 .btn-box button {
  width: 95%;
  height: 95%;
  /* border-radius: 50%; */
}

.page-3 .btn-box button.run {
  background-color: red;
}

.page-3 .btn-box button.stop {
  background-color: rgba(103, 198, 113, 1);
}

.page-3 .controls .channels {
  flex-direction: column;
}

.page-3 .channels .buttons {
  display: grid;
  grid-template-columns: 42% 42%;
  grid-column-gap: 16%;
  grid-row-gap: 5px;
  width: 84%;
  margin: 10px auto;
}

.page-3 .channels .buttons button {
  height: 26px;
  background-color: #c7e2f7;
  border-radius: 3px;
  border: 0;
}

.page-3 .channels button.channel-active {
  background-color: darkorange;
}

.page-3 .controls .events {
  flex-direction: column;
  margin: 1px 0;
}

.page-3 .events .values {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  grid-row-gap: 5px;
  grid-column-gap: 5px;
  margin: 2px;
  text-align: right;
}

.page-3 .events .values .title {
  height: 24px;
  color: gray;
}

.page-3 .events .values .value {
  background-color: #c7e2f7;
  line-height: 24px;
  padding-right: 2px;
  font-weight: bold;
}

/* page-4 = mainbox(redlaser + controls) */

.page-4 .mainbox {
  grid-template-columns: 80% 20%;
  background-color: azure;
}

.page-4 .redlaser {
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  align-content: center;
}

.page-4 .redlaser img {
  width: 300px;
  height: 250px;
}

.page-4 .controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  background: aliceblue;
}

.page-4 .controls .control {
  display: flex;
  justify-content: space-between;
  margin: 1px 0;
}

.page-4 .controls .control select {
  flex: 1 0 auto;
  margin-left: 2px;
  background-color: bisque;
  border-radius: 3px;
  border: 0;
  height: 30px;
  text-align: center;
}

.page-4 .controls .status {
  height: 62px;
  align-items: flex-start;
}

.page-4 .controls .status button {
  height: 35px;
  line-height: 35px;
}

.page-4 .controls .status select {
  height: 35px;
}

.page-4 .controls .channels {
  flex-direction: column;
}

.page-4 .channels .buttons {
  display: grid;
  grid-template-columns: 42% 42%;
  grid-column-gap: 16%;
  grid-row-gap: 5px;
  width: 84%;
  margin: 10px auto;
}

.page-4 .channels .buttons button {
  height: 26px;
  background-color: #c7e2f7;
  border-radius: 3px;
  border: 0;
}

.page-4 .channels button.channel-active {
  background-color: darkorange;
}

/* page-0 */

.page-0 .mainbox {
  justify-items: center;
  grid-row-gap: 20px;
  align-content: center;
}

.page-0 .panel {
  background-color: lightgray;
  width: 90%;
  border-radius: 10px;
  display: flex;
}

.page-0 .panel .title {
  text-align: right;
  margin: 3px 6px;
  color: #795548;
}

.page-0 .panel .footer {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.page-0 .panel .footer button {
  margin-bottom: 1px;
  border-radius: 4px;
  /* width: 50px; */
}

.page-0 .panel .options {
  display: grid;
  grid-template-columns: 40% 40%;
  width: 80%;
  margin: 20px auto 15px auto;
  grid-row-gap: 10px;
  justify-content: space-around;
  align-items: center;
}

.page-0 .panel-advanced .options {
  /* grid-template-columns: 35% 35% 30%; */
}

.page-0 .option span {
  width: 100px;
  text-align: right;
  display: inline-block;
  margin-right: 10px;
}

.page-0 .option span.short {
  /* width: auto; */
}

.page-0 .option .input {
  width: 100px;
  height: 26px;
  border: 0;
  border-radius: 3px;
  background-color: aliceblue;
  text-align: center;
}

.page-0 .option .switch {
  width: auto;
  margin-left: 8px;
  color: gray;
}

.page-0 .option .switch-on {
  color: #2196f3;
}

.page-0 .option input[type="checkbox"] {
  height: 20px;
  width: 20px;
  vertical-align: middle;
}

.page-0 .options input.raman {
  width: 70px;
  margin-right: 10px;
}

.page-0 .options input.raman[type="number"]:disabled {
  background-color: darkgray;
}

/* pop_layer */

.pop_layer {
  display: none;
}

/* range_layer */

.range_layer .rangebox {
  margin: 5px 15px 15px 15px;
}

.range_layer .values {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.range_layer .values .value {
  background: aliceblue;
  color: red;
  width: 100px;
  text-align: center;
  border: none;
  font-size: 18px;
  transform: none;
}

.range_layer input {
  width: 50%;
  transform: scale(2);
  transform-origin: left center;
}

/* upload_layer */

.upload_layer input[type="file"] {
  display: none;
}

.upload_layer input[type="text"] {
  border: 1px solid #eee;
  text-align: center;
  width: 90%;
  background-color: #f1eeee;
}

.upload_layer input[type="text"].coil {
  width: 80%;
  margin-left: 5%;
}

.upload_layer table {
  text-align: center;
}

.upload_layer td.title {
  width: 40px;
  padding: 4px 5px;
}

.upload_layer td.content {
  width: 30vw;
  padding: 5px;
}

.upload_layer td.image {
  padding: 2px;
  height: 53vh;
}

.upload_layer td.address {
  color: forestgreen;
}

.upload_layer td.position input {
  border-color: red;
}

.upload_layer td.length {
  padding: 0 5px 0 8px;
}

.upload_layer td.length table td {
  padding: 0;
  border: 0;
}

.upload_layer td.length table td.total {
  width: 48px;
}

.upload_layer td.length table td.coil {
  width: 64px;
}

.upload_layer td.length table td.input span {
  margin-left: -16px;
  color: #ff5722;
}

.upload_layer img {
  max-width: 100%;
  max-height: 53vh;
  height: 100%;
}

.upload_layer input.name_input {
  width: 65%;
}

.upload_layer input.position_input {
  width: 96%;
}

.upload_layer button.open_fiber_manager {
  width: 30px;
  margin-left: 8px;
}

.upload_layer select {
  width: 96%;
}

.upload_layer span.unit {
  margin-left: 3px;
}

/* otdr_options */

.otdr_options .options {
  background-color: whitesmoke;
  display: grid;
  grid-row-gap: 5px;
  justify-content: space-around;
  align-items: center;
  padding: 10px;
  grid-template-columns: 50% 50%;
}

.otdr_options .option span {
  width: 100px;
  text-align: right;
  display: inline-block;
  margin-right: 10px;
}

.otdr_options .option .input {
  width: 100px;
  height: 30px;
  border: 0;
  border-radius: 3px;
  background-color: #d3e6f6;
  text-align: center;
}

/* otdr_events */

.otdr_events table tr {
  cursor: pointer;
}

.otdr_events table tr.row-active {
  background-color: #ffb800;
}

/* ofck_chart */

.ofck_chart .ofck {
  width: 60vw;
  height: 60vh;
}

/* fiber_manager_choose */

.fiber_manager_choose select {
  height: 30px;
}

.fiber_manager_choose input {
  height: 28px;
  width: 99%;
}

.fiber_manager_choose button {
  height: 60px;
}

/* fiber_manager_create */

.fiber_manager_create select {
  height: 30px;
}

.fiber_manager_create input {
  height: 28px;
  width: 96%;
  margin-left: 2px;
}

/* fix */

.layui-layer-title {
  border-bottom: 0 !important;
}

.layui-layer-btn {
  text-align: center !important;
}