﻿/* 定义 CSS 变量 */
:root {
  --primary-color: #5bc0de;
  --secondary-color: dodgerblue;
  --border-color: #ccc;
  --light-border-color: #eee;
  --text-color: #555;
  --white-color: #fff;
  --gray-color: #ddd;
}

/* 全局样式 */
* {
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-color);
  box-sizing: border-box;
  caret-color: transparent;
  user-select: none;
}

input,td {
  caret-color: auto;
  user-select: text;
}

a {
  text-decoration: none;
}

/* 布局组件 */
.main {
  display: grid;
  grid-template-rows: repeat(3, auto);
  grid-template-columns: 90%;
  justify-content: center;
  justify-items: center;
  row-gap: 15px;
  padding: 10px;
}

.main-item {
  width: 80%;
  max-width: 1280px;
  padding: 0 10px;
  text-align: center;
}

/* 表单元素 */
form {
  display: inline-flex;
  width: 90%;
  justify-content: center;
}

input,
textarea {
  padding: 5px;
  border: 1px solid var(--border-color);
}

textarea {
  resize: none;
}

input:focus,
textarea:focus {
  outline-color: var(--secondary-color);
}

/* 按钮和交互元素 */
button,
.track a {
  background-color: var(--primary-color);
  border: 1px solid transparent;
  outline: none;
  border-radius: 4px;
  padding: 0;
  margin: 0 35px;
  position: relative;
}

button:hover,
.down-menu div:hover,
.tracks a:hover {
  background-color: var(--secondary-color);
}

button:focus {
  border-color: var(--secondary-color);
}

button a {
  padding: 0 15px;
}

/* iframe样式 */
iframe {
  position: absolute;
  overflow: hidden;
  z-index: -1;
  width: 100%;
  left: 0;
  margin: 0;
  border: none;
}

/* 分组样式 */
.group {
  position: relative;
  display: table;
  margin: auto;
  width: 70%;
  min-width: 350px;
}

.group:first-child {
  margin-bottom: 10px;
}

.group label {
  display: table-cell;
  background-color: var(--light-border-color);
  border: 1px solid var(--border-color);
  width: 15%;
}

.group input {
  display: table-cell;
  border: 1px solid var(--border-color);
  width: 100%;
  height: 30px;
}

.group label:first-child {
  border-right: 0;
  border-radius: 4px 0 0 4px;
}

.group label[class='end'] {
  border-left: 0;
}

.end {
  border-radius: 0 4px 4px 0;
}

/* 自动完成下拉框 */
.auto {
  position: relative;
  text-align: left;
}

.drop {
  position: absolute;
  overflow: auto;
  background-color: var(--white-color);
  border: 1px solid var(--border-color);
  z-index: 99;
  max-height: 420px;
  top: 30px;
  width: 100%;
}

.drop div {
  border: 1px solid var(--border-color);
  border-top: none;
  padding: 4px 12px;
}

.drop div:hover {
  background-color: var(--white-color);
}

/* 导航栏 */
.nav {
  display: inline-grid;
  grid-template-columns: repeat(4, auto);
  justify-content: space-between;
}

.nav *,
.nav a {
  color: var(--white-color);
}

.nav button > div:first-child {
  display: inline-block;
  padding: 7px 22px;
}

#btn {
  position: relative;
  padding-left: 20px;
  padding-right: 3px;
}

.down {
  padding: 7px 18px 7px 3px;
}

.hide {
  display: none;
}

.down-menu {
  position: absolute;
  z-index: 999;
  background-color: var(--white-color);
  border: 1px solid var(--border-color);
  width: 100%;
  padding: 2px;
}

.down-menu div {
  color: black;
  padding: 3px;
}

/* 标签页 */
.tabs {
  display: flex;
  padding-left: 0;
  margin-bottom: 0;
}

.tabs div {
  display: inline-block;
  position: relative;
  padding: 10px 15px;
  border-radius: 5px 5px 0 0;
}

/* 包裹样式 */
.pack div {
  display: inline-block;
  width: 25%;
  margin: 5px 20px;
  border-radius: 10px;
  border: 2px solid var(--white-color);
}

.ontabs,
.onpack {
  border: 2px solid var(--white-color);
  background-color: var(--white-color);
}

/* 表格样式 */
.remote {
  max-width: 800px;
  margin: auto;
}

table {
  width: 100%;
  border-spacing: 0;
  border-collapse: collapse;
  border-bottom: 2px solid var(--white-color);
}

td {
  padding: 8px;
  border: 2px solid var(--white-color);
  border-bottom: 0;
}

td div {
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
  text-align: left;
  height: 18px;
}

tr:hover {
  background-color: var(--gray-color);
}

.shows div {
  height: auto;
}

.tb td:nth-child(1) {
  width: 20%;
}

.tb td:nth-child(2) {
  width: 12%;
}

.tb td:nth-child(3) {
  width: 15%;
}

.pack {
  border: 2px solid var(--white-color);
  border-bottom: 0;
}

/* 背景样式 */
.backimg {
  background-color: #d2e1ec;
  background-image: linear-gradient(to bottom, #bbcfe1 0%, #e8f2f6 80%);
  background-attachment: fixed;
}

canvas {
  position: fixed;
  z-index: -1;
  width: 100%;
  left: 0;
  bottom: 0;
}

/* 搜索样式 */
.hs label {
  font-size: 16px;
  font-weight: 700;
  padding-right: 5px;
}

.hs input {
  margin-right: 10px;
  width: 210px;
  border-radius: 4px;
}

.hs button {
  min-width: 50px;
  margin: 0;
  padding: 0 15px;
}

/* 跟踪样式 */
.track div {
  display: table;
  width: 100%;
  margin: 10px auto;
}

.track input {
  display: table-cell;
  border-radius: 4px;
  height: 35px;
  width: 98%;
  padding: 5px;
}

.track a {
  display: table-cell;
  width: 16%;
  padding: 0 5px;
  border: 1px solid var(--light-border-color);
}

.track a:first-child {
  width: 22%;
  color: black;
  font-weight: 700;
  background-color: var(--white-color);
}

/* 跟踪列表 */
.tracks {
  display: flex;
  flex-direction: column;
  max-width: 768px;
  margin: 10px auto;
}

.tracks a,
.tracks textarea {
  width: 100%;
  margin: 5px;
  padding: 5px;
  border-radius: 5px;
}

.tracks a {
  display: table-cell;
  background-color: var(--primary-color);
}

/* 图片样式 */
.img {
  height: 40px;
  width: 200px;
  margin: 0 auto 20px auto;
}

/* 加载动画 */
.load {
  margin-top: 100px;
  position: relative;
}

.arc {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border-top: 2px solid #ffea29;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
  animation: rt 2s infinite linear;
  position: absolute;
  margin: auto;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.arc::before,
.arc::after {
  position: absolute;
  margin: auto;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  content: "";
}

.arc::before {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border-top: 2px solid #8d29ff;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
  animation: rt 4s infinite linear reverse;
}

.arc::after {
  width: 0;
  height: 0;
  border-radius: 50%;
  border-top: initial;
  border-left: initial;
  border-right: initial;
  animation: cw 1s infinite;
  background: red;
}

.load h1 {
  position: absolute;
  font-weight: 700;
  height: 40px;
  margin: auto;
  top: 200px;
  left: 0;
  right: 0;
  bottom: 0;
}

.load h1::after {
  animation: txt 5s infinite;
  content: "";
}

/* 动画关键帧 */
@keyframes rt {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes cw {
  0% {
    width: 0;
    height: 0;
  }
  75% {
    width: 40px;
    height: 40px;
  }
  100% {
    width: 0;
    height: 0;
  }
}

@keyframes txt {
  0% {
    content: "加载中.";
  }
  50% {
    content: "加载中..";
  }
  100% {
    content: "加载中...";
  }
}

/* 媒体查询 - 大屏幕 */
@media screen and (min-width: 1081px) {
  .hs input {
    width: 250px;
  }

  .main-item,
  form {
    width: 90%;
  }

  .main > .main-item > form {
    width: 70%;
  }
}

/* 媒体查询 - 中屏幕 */
@media screen and (min-width: 769px) and (max-width: 1080px) {
  .main-item,
  form {
    width: 100%;
  }

  button {
    margin: 0 25px;
  }
}

/* 媒体查询 - 小屏幕 */
@media screen and (max-width: 768px) {
  .main {
    grid-template-columns: 100%;
  }

  .main-item,
  .group,
  .track,
  form {
    width: 100%;
    padding: 0;
  }

  form {
    display: inline-block;
  }

  form > div:last-child {
    margin-top: 10px;
  }

  .group input {
    height: 35px;
  }

  .group label {
    width: 16%;
  }

  .drop {
    top: 37px;
  }

  #hide,
  .no[colspan] {
    display: none;
  }

  button {
    margin: 0 12px;
  }

  .nav button > div:first-child {
    padding: 7px 15px;
  }

  .pack div {
    width: 30%;
    margin: 5px;
    padding: 2px;
    border-radius: 15px;
  }

  #home,
  #remote {
    width: 80px;
  }
}