* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  color: #ffffff;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Microsoft YaHei', Arial, sans-serif;
}

button {
  font-family: inherit;
}

.line-select-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(
      circle at 18% 10%,
      rgba(17, 38, 72, 0.58) 0,
      transparent 28%
    ),
    radial-gradient(
      circle at 92% 2%,
      rgba(14, 80, 78, 0.46) 0,
      transparent 30%
    ),
    linear-gradient(145deg, #0d1020 0%, #10141b 48%, #171318 100%);
}

.line-select-shell {
  width: min(420px, 100%);
}

.line-select-card {
  --column-gap: 8px;
  --tag-width: 42px;
  --latency-width: 54px;
  --visit-width: 52px;
  width: 100%;
  padding: 22px 16px;
  color: #f4f4f1;
  background: rgba(30, 31, 33, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  box-shadow:
    0 26px 80px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(10px);
  animation: fade-rise 0.45s ease both;
}

.line-fastest,
.line-recommend,
.line-option {
  width: 100%;
  font-family: inherit;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.line-fastest {
  min-height: 82px;
  padding: 15px 14px 14px;
  color: #27d66a;
  background: rgba(26, 67, 42, 0.72);
  border: 1px solid rgba(45, 183, 89, 0.52);
  border-radius: 18px;
  box-shadow:
    inset 0 0 22px rgba(33, 155, 82, 0.18),
    0 0 0 1px rgba(13, 54, 28, 0.5);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.line-fastest:hover,
.line-fastest:focus-visible {
  background: rgba(28, 82, 48, 0.82);
  border-color: rgba(58, 220, 111, 0.76);
  outline: none;
}

.line-fastest:active {
  transform: scale(0.985);
}

.line-fastest-title {
  display: block;
  margin-bottom: 10px;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.line-fastest-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--column-gap);
  color: rgba(216, 229, 221, 0.82);
  font-size: 13px;
  white-space: nowrap;
}

.line-fastest-meta em,
.line-option em,
.line-recommend i {
  min-width: 38px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  border-radius: 12px;
}

.line-fastest-meta strong {
  color: #35d673;
  font-size: 14px;
  font-weight: 800;
}

.line-fastest-meta b {
  color: #d7d7d7;
  font-weight: 600;
}

.line-dot {
  color: rgba(255, 255, 255, 0.35);
}

.line-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 16px;
  color: #d6a338;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.line-section-title span {
  height: 1px;
  flex: 1;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(202, 138, 4, 0.55),
    transparent
  );
}

.line-section-title strong {
  white-space: nowrap;
}

.line-recommend {
  min-height: 50px;
  margin-top: 16px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 64px 44px 58px;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  color: #f5f0df;
  text-align: left;
  background: rgba(83, 56, 23, 0.55);
  border: 1px solid rgba(161, 103, 28, 0.7);
  border-radius: 12px;
  box-shadow: inset 0 0 20px rgba(181, 119, 32, 0.12);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.line-recommend:hover,
.line-recommend strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-recommend em,
.line-recommend b,
.line-option b {
  min-width: 58px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f6d482;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  background: rgba(126, 82, 25, 0.76);
  border-radius: 10px;
}

.line-section-title {
  margin: 22px 0 14px;
  color: rgba(255, 255, 255, 0.34);
}

.line-section-title span {
  background: rgba(255, 255, 255, 0.1);
}

.line-options {
  display: grid;
  gap: 18px;
}

.line-option {
  min-height: 48px;
  display: grid;
  grid-template-columns: max-content var(--tag-width) var(--latency-width) var(
      --visit-width
    );
  align-items: center;
  justify-content: space-between;
  gap: var(--column-gap);
  padding: 8px 12px;
  color: #eeeeee;
  text-align: left;
  background: rgba(58, 59, 61, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.line-option.active {
  background: rgba(55, 65, 63, 0.72);
  border-color: rgba(37, 211, 102, 0.26);
  box-shadow: inset 0 0 16px rgba(28, 163, 83, 0.08);
  outline: none;
}

.line-flag {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.line-name {
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-option b {
  min-width: 58px;
  color: #d8d8d8;
  background: rgba(94, 95, 98, 0.72);
}

.line-option.active b {
  color: #3ee07c;
  background: rgba(28, 103, 62, 0.54);
}

.line-tag-fast {
  background: #13a85f;
  box-shadow: 0 0 16px rgba(19, 168, 95, 0.5);
}

.line-tag-hot {
  background: #ff3838;
  box-shadow: 0 0 16px rgba(255, 44, 44, 0.48);
}

@keyframes fade-rise {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 520px) {
  .line-select-page {
    padding: 14px;
  }

  .line-select-card {
    --column-gap: 7px;
    padding: 18px 12px;
    border-radius: 22px;
  }

  .line-fastest {
    min-height: 76px;
    padding: 13px 10px 12px;
    border-radius: 16px;
  }

  .line-fastest-title {
    margin-bottom: 8px;
    font-size: 18px;
  }

  .line-fastest-meta {
    gap: 5px;
    font-size: 12px;
  }

  .line-section-title {
    gap: 7px;
    margin: 17px 0 14px;
    font-size: 12px;
  }

  .line-section-title {
    margin-top: 18px;
  }

  .line-recommend,
  .line-option {
    min-height: 47px;
    gap: 7px;
    padding: 8px 10px;
  }

  .line-recommend {
    grid-template-columns: 26px minmax(0, 1fr) 58px 42px 54px;
  }

  .line-flag {
    width: 26px;
    height: 26px;
    font-size: 17px;
  }

  .line-name {
    font-size: 14px;
  }

  .line-fastest-meta em,
  .line-option em,
  .line-recommend i {
    min-width: 36px;
    height: 21px;
    font-size: 11px;
  }

  .line-recommend em,
  .line-recommend b,
  .line-option b {
    min-width: 54px;
    height: 23px;
  }
}

@media (min-width: 521px) and (max-height: 780px) {
  .line-select-page {
    align-items: flex-start;
  }

  .line-select-shell {
    max-width: 390px;
  }

  .line-select-card {
    padding: 18px 16px;
    border-radius: 22px;
  }

  .line-fastest {
    min-height: 74px;
    padding: 13px 12px;
  }

  .line-fastest-title {
    margin-bottom: 8px;
  }

  .line-section-title {
    margin: 18px 0 15px;
    font-size: 14px;
  }

  .line-section-title {
    margin-top: 18px;
  }

  .line-recommend,
  .line-option {
    min-height: 47px;
    padding: 8px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.line-options .line-option {
  gap: var(--column-gap);
  cursor: default;
}
.line-region {
  display: flex;
  align-items: center;
  gap: var(--column-gap);
  min-width: 0;
}
.line-region .line-flag {
  flex: none;
  width: 22px;
}
.line-options .line-option b {
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.line-visit {
  height: 30px;
  border: 1px solid #44805d;
  border-radius: 8px;
  padding: 0;
  background: #274737;
  color: #a7f2c6;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.line-visit:hover {
  background: #34684b;
}
.line-visit:focus-visible {
  outline: 2px solid #73dda0;
  outline-offset: 2px;
}
.line-select-card .line-recommend {
  grid-template-columns: max-content max-content var(--tag-width) var(
      --latency-width
    );
  justify-content: space-between;
  gap: var(--column-gap);
  cursor: default;
}
.line-select-card .line-recommend em {
  min-width: 0;
  padding-inline: 7px;
  white-space: nowrap;
}
.line-select-card .line-recommend b {
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
#fastestLatency {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 360px) {
  .line-select-card {
    --column-gap: 5px;
    --tag-width: 38px;
    --latency-width: 44px;
    --visit-width: 44px;
  }
  .line-options .line-option,
  .line-select-card .line-recommend {
    padding-inline: 7px;
  }
  .line-region .line-flag {
    width: 18px;
  }
  .line-visit {
    font-size: 12px;
  }
}

.latency-example {
  font-size: 0.75em;
  opacity: 0.8;
}
