:root {
  --klein-main: #002FA7;
  --klein-dark: #001C61;
  --klein-medium: #3559A8;
  --klein-light: #4682BF;
  --klein-extra-light: #A2BFFF;
  --klein-bg: #f4f7fb;
  --klein-border: #4682BF;
  --header-gradient: linear-gradient(90deg, #002FA7 0%, #3559A8 50%, #4682BF 100%);
}

html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  background: var(--klein-bg);
  font-family: "Gill Sans", sans-serif !important;
  color: var(--klein-main);
  box-sizing: border-box;
  overflow-x: hidden;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  min-height: 100vh;
  box-sizing: border-box;
  padding: 3vw 2vw 6vw 2vw;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

.title {
  text-align: center;
  font-size: clamp(2rem, 4vw, 3.5rem); /* 自动根据屏幕宽度调节字体 */
  font-weight: bold;
  margin-bottom: 4vw;
  letter-spacing: 0.5vw;
  color: var(--klein-main);
  text-shadow: 1px 2px 6px var(--klein-extra-light);
}

.current-time {
  margin-bottom: 2vw;
  font-size: clamp(1.1rem, 1.8vw, 2rem); /* 自动根据屏幕宽度调节字体 */
  color: var(--klein-main);
}

.cd-table-wrap {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 2px 18px rgba(0, 47, 167, 0.08);
  border: 2px solid var(--klein-border);
  overflow: hidden;
  box-sizing: border-box;
}

table.cd-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: clamp(1.1rem, 1.7vw, 1.5rem); /* 自动根据屏幕宽度调节字体 */
  background: #fff;
  color: var(--klein-main);
  table-layout: fixed;
}

table.cd-table th,
table.cd-table td {
  padding: 1.2em 0.5em;
  border-bottom: 1px solid var(--klein-extra-light);
  width: 33.33%;
  white-space: nowrap;
  word-break: break-all;
  font-size: 1.2em;
  overflow: visible;
  text-overflow: clip;
  vertical-align: middle;
}

table.cd-table th {
  background: var(--header-gradient);  /* 使用新的浅色渐变 */
  color: #fff;
  font-weight: bold;
  font-size: clamp(1.2rem, 2vw, 2rem);  /* 自动根据屏幕宽度调节字体 */
  letter-spacing: 1px;
  text-shadow: 0 1px 3px var(--klein-medium);
  line-height: normal;
}

table.cd-table tr:last-child td {
  border-bottom: none;
}

table.cd-table td {
  background: #fff;
  color: var(--klein-main);
  font-weight: 500;
  font-size: clamp(1rem, 1.5vw, 1.8rem); /* 自动根据屏幕宽度调节字体 */
  transition: background 0.2s;
}

table.cd-table tr:nth-child(even) td {
  background: #f7fafd;
}

.cd-remain {
  color: var(--klein-dark);
  font-weight: bold;
  font-size: clamp(1.2rem, 2vw, 2rem);
}

@media (max-width: 700px) {
  .title {
    font-size: 7vw;
  }

  .current-time {
    font-size: 3vw;
  }

  .cd-table-wrap {
    max-width: 98vw;
  }

  table.cd-table {
    font-size: 3vw;
  }

  table.cd-table th,
  table.cd-table td {
    font-size: 1em;
    padding: 0.8em 0.2em;
  }

  .cd-remain {
    font-size: 4vw;
  }

  table.cd-table td {
    white-space: normal;
    word-wrap: break-word;
  }
}

@media (max-width: 450px) {
  .title {
    font-size: 9vw;
  }

  .current-time {
    font-size: 4vw;
  }

  .cd-table-wrap {
    max-width: 100vw;
  }

  table.cd-table {
    font-size: 4vw;
  }

  table.cd-table th,
  table.cd-table td {
    font-size: 0.9em;
    padding: 0.5em 0.1em;
  }

  .cd-remain {
    font-size: 5vw;
  }

  table.cd-table td {
    white-space: normal;
    word-wrap: break-word;
  }
}

::-webkit-scrollbar {
  width: 6px;
  background: #f0f0f0;
}

::-webkit-scrollbar-thumb {
  background: var(--klein-extra-light);
  border-radius: 6px;
}

.grade-tag {
  display: inline-flex;                     /* 使用 flex 实现精确居中 */
  align-items: center;                     /* 垂直居中 */
  justify-content: center;                 /* 水平居中 */
  background-color: var(--klein-main);
  color: white;
  border-radius: 999px;                    /* 更圆润气泡视觉 */
  padding: 0.4em 0.8em;                    /* 上下左右 padding 更平衡 */
  font-size: 0.9em;
  margin: 0 0.4em 0.4em 0;
  box-shadow: 0 1px 3px rgba(0, 47, 167, 0.3);
  white-space: normal;                     /* 允许换行 */
  word-break: break-word;                  /* 内容过长时断字 */
  text-align: center;
  max-width: 100%;                         /* 防止溢出父容器 */
  line-height: 1.2;                        /* 防止换行后行距太紧 */
  vertical-align: middle;     /* 这一行让标签对齐周围文字行高 */
}
