:root {
  --bg-top: #aab4c1;
  --bg-mid: #555e65;
  --bg-bottom: #171c1e;

  --panel-top: #104543;
  --panel-bottom: #073f3d;

  --text-main: rgba(239, 244, 244, 0.96);
  --text-sub: rgba(224, 231, 228, 0.72);
  --text-dim: rgba(224, 231, 228, 0.52);

  --blue: #56b8ff;
  --blue-deep: #167be1;
  --blue-line: rgba(27, 144, 234, 0.48);

  --green: #5cf2cc;
  --green-2: #00b88c;
  --green-line: rgba(0, 184, 140, 0.42);
  --green-soft: rgba(0, 184, 140, 0.16);

  --red: #ff8e8e;
  --red-line: rgba(255, 120, 120, 0.38);
  --red-soft: rgba(255, 120, 120, 0.14);

  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    Arial,
    sans-serif;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 28px 18px;
  color: var(--text-main);

  background:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(
      180deg,
      var(--bg-top) 0%,
      #929ba5 10%,
      var(--bg-mid) 35%,
      #262d2f 68%,
      var(--bg-bottom) 100%
    );

  background-size:
    32px 32px,
    32px 32px,
    100% 100%;
}

#app {
  width: 100%;
  display: flex;
  justify-content: center;
}

.detect-panel {
  width: 676px;
  max-width: 100%;
  min-height: 812px;
  padding: 34px 38px 36px;
  border-radius: 24px;
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* 顶部标题 */

.detect-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 22px;
  margin-bottom: 22px;
}

.header-dot {
  position: absolute;
  left: 61px;
  top: 1px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #1268c8;
  box-shadow: 0 0 0 5px rgba(18, 104, 200, 0.08);
}

.heartbeat {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
}

.heartbeat svg {
  width: 39px;
  height: 39px;
  overflow: visible;
}

.header-text {
  padding-top: 12px;
}

.detect-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.detect-subtitle {
  margin-top: 8px;
  color: rgba(221, 228, 221, 0.72);
  font-size: 20px;
  line-height: 1.45;
  font-weight: 500;
}

/* 进度区域 */

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  margin-bottom: 14px;
}

.progress-label {
  color: rgba(221, 228, 221, 0.72);
  font-size: 19px;
  font-weight: 500;
}

.progress-count {
  display: flex;
  align-items: baseline;
  gap: 11px;
}

.progress-current {
  font-size: 20px;
  line-height: 1;
  font-weight: 800;
  color: rgba(239, 244, 244, 0.96);
}

.progress-percent {
  font-size: 17px;
  color: rgba(221, 228, 221, 0.64);
  font-weight: 500;
}

.progress-track {
  width: 100%;
  height: 12px;
  margin-bottom: 30px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(25, 28, 29, 0.58);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #167be1, #36c4ff);
  transition: width 0.35s ease;
}

/* 线路卡片 */

.route-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.route-card {
  min-height: 106px;
  padding: 22px 23px;
  border-radius: 24px;
  border: 1.5px solid var(--green-line);
  background: rgba(0, 39, 38, 0.19);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
}

.route-card.best {
  border-color: var(--blue-line);
  background: rgba(1, 64, 82, 0.24);
  box-shadow: inset 0 0 0 1px rgba(38, 160, 255, 0.06);
}

.route-card.failed {
  border-color: var(--red-line);
  background: rgba(74, 24, 24, 0.15);
}

.route-left {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.status-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.route-name {
  margin-bottom: 12px;
  color: rgba(237, 241, 241, 0.96);
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
}

.signal-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(221, 228, 221, 0.56);
  font-size: 15px;
  font-weight: 600;
}

.signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  width: 22px;
  height: 18px;
}

.signal-bars i {
  display: block;
  width: 4px;
  border-radius: 4px;
  background: rgba(0, 194, 140, 0.9);
}

.signal-bars i:nth-child(1) {
  height: 7px;
  opacity: 0.72;
}

.signal-bars i:nth-child(2) {
  height: 11px;
  opacity: 0.84;
}

.signal-bars i:nth-child(3) {
  height: 16px;
}

.route-card.testing .signal-bars i {
  animation: signalPulse 1.05s ease-in-out infinite;
}

.route-card.testing .signal-bars i:nth-child(2) {
  animation-delay: 0.15s;
}

.route-card.testing .signal-bars i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes signalPulse {
  0%,
  100% {
    opacity: 0.35;
  }

  50% {
    opacity: 1;
  }
}

.route-pill {
  flex: 0 0 auto;
  min-width: 145px;
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0, 154, 117, 0.16);
  color: #75f1d8;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.route-card.testing .route-pill {
  color: rgba(231, 236, 236, 0.66);
  background: rgba(255, 255, 255, 0.06);
}

.route-card.failed .route-pill {
  color: #ffb0b0;
  background: var(--red-soft);
}

/* 底部状态栏 */

.bottom-status {
  margin-top: 30px;
  min-height: 78px;
  padding: 18px 20px;
  border-radius: 24px;
  border: 1.5px solid rgba(24, 142, 226, 0.44);
  background: rgba(0, 52, 66, 0.22);

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;

  color: rgba(238, 243, 243, 0.94);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-align: center;
}

.bottom-status.error {
  border-color: var(--red-line);
  background: rgba(80, 26, 26, 0.18);
  color: #ffd0d0;
}

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(89, 179, 255, 0.25);
  border-top-color: #69bfff;
  animation: spin 0.85s linear infinite;
  flex: 0 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 禁用 JS 时 */

.noscript-box {
  width: 676px;
  max-width: 100%;
  padding: 28px;
  border-radius: 22px;
  background: rgba(7, 63, 61, 0.96);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 18px;
  line-height: 1.8;
}

/* 移动端 */

@media (max-width: 760px) {
  body {
    padding: 16px 12px;
  }

  .detect-panel {
    width: 100%;
    min-height: auto;
    padding: 24px 18px 22px;
    border-radius: 20px;
  }

  .detect-header {
    gap: 12px;
    margin-bottom: 18px;
  }

  .heartbeat {
    width: 38px;
    height: 38px;
    margin-top: 11px;
  }

  .heartbeat svg {
    width: 32px;
    height: 32px;
  }

  .header-dot {
    left: 47px;
    top: 0;
    width: 12px;
    height: 12px;
  }

  .header-text {
    padding-top: 7px;
  }

  .detect-title {
    font-size: 23px;
  }

  .detect-subtitle {
    margin-top: 6px;
    font-size: 16px;
  }

  .progress-label {
    font-size: 16px;
  }

  .progress-current {
    font-size: 18px;
  }

  .progress-percent {
    font-size: 15px;
  }

  .progress-track {
    height: 10px;
    margin-bottom: 22px;
  }

  .route-list {
    gap: 11px;
  }

  .route-card {
    min-height: 92px;
    padding: 18px 16px;
    border-radius: 20px;
    gap: 12px;
  }

  .route-left {
    gap: 13px;
  }

  .status-icon {
    width: 20px;
    height: 20px;
  }

  .route-name {
    font-size: 19px;
    margin-bottom: 9px;
  }

  .signal-row {
    font-size: 13px;
    gap: 9px;
  }

  .route-pill {
    min-width: 116px;
    height: 36px;
    padding: 0 13px;
    font-size: 15px;
  }

  .bottom-status {
    margin-top: 22px;
    min-height: 68px;
    padding: 15px 14px;
    border-radius: 20px;
    font-size: 17px;
    gap: 12px;
  }

  .spinner {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 520px) {
  .route-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .route-pill {
    margin-left: 35px;
  }
}

/************************************************************
 * 紧凑版：整体缩小界面
 * 直接追加到 CSS 最底部
 ************************************************************/

body {
  padding: 18px 12px;
}

.detect-panel {
  width: 520px;
  min-height: auto;
  padding: 26px 30px 28px;
  border-radius: 22px;
}

.detect-header {
  gap: 16px;
  margin-bottom: 16px;
}

.heartbeat {
  width: 40px;
  height: 40px;
  margin-top: 11px;
}

.heartbeat svg {
  width: 32px;
  height: 32px;
}

.header-dot {
  left: 51px;
  top: 0;
  width: 12px;
  height: 12px;
  box-shadow: 0 0 0 4px rgba(18, 104, 200, 0.08);
}

.header-text {
  padding-top: 7px;
}

.detect-title {
  font-size: 23px;
}

.detect-subtitle {
  margin-top: 5px;
  font-size: 16px;
}

.progress-head {
  margin-top: 10px;
  margin-bottom: 10px;
}

.progress-label {
  font-size: 15px;
}

.progress-count {
  gap: 8px;
}

.progress-current {
  font-size: 16px;
}

.progress-percent {
  font-size: 14px;
}

.progress-track {
  height: 9px;
  margin-bottom: 20px;
}

.route-list {
  gap: 10px;
}

.route-card {
  min-height: 82px;
  padding: 16px 18px;
  border-radius: 20px;
  gap: 13px;
}

.route-left {
  gap: 13px;
}

.status-icon {
  width: 19px;
  height: 19px;
}

.route-name {
  margin-bottom: 7px;
  font-size: 18px;
}

.signal-row {
  gap: 8px;
  font-size: 13px;
}

.signal-bars {
  width: 18px;
  height: 15px;
  gap: 3px;
}

.signal-bars i {
  width: 3px;
}

.signal-bars i:nth-child(1) {
  height: 6px;
}

.signal-bars i:nth-child(2) {
  height: 9px;
}

.signal-bars i:nth-child(3) {
  height: 13px;
}

.route-pill {
  min-width: 118px;
  height: 34px;
  padding: 0 13px;
  font-size: 14px;
}

.bottom-status {
  margin-top: 20px;
  min-height: 58px;
  padding: 13px 16px;
  border-radius: 20px;
  gap: 11px;
  font-size: 16px;
}

.spinner {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.noscript-box {
  width: 560px;
  padding: 22px;
  border-radius: 20px;
  font-size: 15px;
}

/* 手机端再压缩一点 */
@media (max-width: 760px) {
  body {
    padding: 10px 8px;
  }

  .detect-panel {
    padding: 18px 14px 18px;
    border-radius: 18px;
  }

  .detect-title {
    font-size: 20px;
  }

  .detect-subtitle {
    font-size: 14px;
  }

  .route-card {
    min-height: 76px;
    padding: 14px 14px;
    border-radius: 18px;
  }

  .route-name {
    font-size: 16px;
  }

  .route-pill {
    min-width: 105px;
    height: 32px;
    font-size: 13px;
  }

  .bottom-status {
    min-height: 52px;
    font-size: 15px;
  }
}

@media (max-width: 520px) {
  .route-pill {
    margin-left: 32px;
  }
}