/* Credit Agent 3.0 — mobile-first, desktop at 768px */

:root {
  --color-ink: #222222;
  --color-mint-from: #ddf8e8;
  --color-mint-to: #eefff2;
  --gradient-page: linear-gradient(180deg, var(--color-mint-from) 0%, var(--color-mint-to) 48.558%);
  --gradient-btn-green: linear-gradient(
    0.75deg,
    #7ab53f 2.2%,
    #639d28 36.9%,
    #bfc74c 98.1%
  );
  --gradient-btn-orange: linear-gradient(180deg, #ffcd60 0%, #ff7e42 58.65%);
  --gradient-text-nav: linear-gradient(-5.9deg, #4ab38d 11.3%, #79b31a 79.9%);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-card-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --max-content: 718px;
  --radius-card: 10px;
  --radius-card-md: 20px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Noto Sans SC', system-ui, sans-serif;
  font-size: 16px;
  color: var(--color-ink);
  background: var(--gradient-page);
  -webkit-font-smoothing: antialiased;
}

img,
svg.icon {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* —— Header —— */

.site-header {
  display: none;
  position: relative;
  height: 88px;
  overflow: hidden;
}

.site-header__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.site-header__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header__bookmark {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-header__bookmark .icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.site-header__bookmark span {
  font-size: 20px;
  white-space: nowrap;
}

.site-header__nav-title {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.24px;
  background: var(--gradient-text-nav);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.bookmark-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  text-decoration: none;
  cursor: pointer;
}

.site-header__bookmark {
  text-decoration: none;
  cursor: pointer;
}

.bookmark-bar .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.bookmark-bar span {
  font-size: 14px;
}

/* —— Main —— */

.main {
  width: 100%;
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 12px 40px;
}

.logo-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0 8px;
}

.logo {
  height: 40px;
  width: auto;
  max-width: 111px;
}

/* —— Tips —— */

.tips {
  margin-bottom: 16px;
}

.tips--mobile {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.tips--desktop {
  display: none;
  align-items: center;
  gap: 20px;
  max-width: 702px;
  margin: 0 auto 24px;
}

.tips__label {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.tips__label .icon {
  width: 16px;
  height: 16px;
}

.tips__label span {
  font-size: 12px;
  white-space: nowrap;
}

.tips__marquee {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.tips__marquee-track {
  display: flex;
  width: max-content;
  gap: 32px;
  white-space: nowrap;
  animation: marquee 18s linear infinite;
}

.tips__marquee-track:hover {
  animation-play-state: paused;
}

.tips__marquee-track span {
  font-size: 12px;
}

.tips--desktop .tips__label .icon {
  width: 22px;
  height: 22px;
}

.tips--desktop .tips__label span {
  font-size: 16px;
}

.tips--desktop p {
  margin: 0;
  flex: 1;
  font-size: 16px;
  line-height: 1.5;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* —— Cards —— */

.card {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 16px 16px;
  font-size: 16px;
  font-weight: 500;
}

.card__title .star {
  flex-shrink: 0;
}

.card__title .star--sm {
  width: 6px;
  height: 6px;
}

.card__title .star--md {
  width: 12px;
  height: 12px;
}

.card__title .star--lg {
  width: 16px;
  height: 16px;
}

/* —— Route list —— */

.route-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid #f0f0f0;
}

.route-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 60px;
  padding: 0 12px;
  border-bottom: 1px solid #f0f0f0;
}

.route-item:last-child {
  border-bottom: none;
}

.route-item--fastest .route-item__speed span {
  color: #e67a2e;
  font-weight: 500;
}

.card--testing .route-item {
  opacity: 0.92;
}

.card--testing .btn--retest .icon {
  animation: spin 0.9s linear infinite;
}

.route-item__speed span[data-speed-value] {
  min-width: 3.5em;
  text-align: right;
}

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

.btn--retest:disabled {
  opacity: 0.75;
  cursor: wait;
}

.route-item__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.route-item__name {
  flex: 1;
  min-width: 0;
  font-size: 16px;
}

.route-item__speed {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.route-item__speed .icon {
  width: 14px;
  height: 14px;
}

.route-item__speed span {
  font-size: 14px;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 32px;
  min-width: 80px;
  padding: 4px 12px;
  border: none;
  border-radius: 50px;
  font-family: inherit;
  font-size: 14px;
  color: #fff;
  cursor: pointer;
  background: var(--gradient-btn-green);
}

.btn--orange {
  background: var(--gradient-btn-orange);
}

.btn--retest {
  gap: 4px;
  height: 32px;
  padding: 8px 16px;
}

.btn--retest .icon {
  width: 18px;
  height: 18px;
}

.card__footer {
  display: flex;
  justify-content: center;
  padding: 20px 16px;
}

/* —— App banner —— */

.app-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
  margin-top: 16px;
  padding: 0 8px;
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.app-banner__icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 5px;
}

.app-banner__text {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

/* —— Desktop (768px+) —— */

@media (min-width: 768px) {
  .site-header {
    display: block;
  }

  .bookmark-bar {
    display: none;
  }

  .main {
    padding: 0 16px 64px;
  }

  .logo-wrap {
    padding: 24px 0 8px;
  }

  .logo {
    height: 64px;
    max-width: 178px;
  }

  .tips--mobile {
    display: none;
  }

  .tips--desktop {
    display: flex;
  }

  .card {
    border-radius: var(--radius-card-md);
    box-shadow: var(--shadow-card-md);
  }

  .card__title {
    gap: 8px;
    padding: 24px 16px;
    font-size: 20px;
  }

  .card__title .star--sm {
    width: 14px;
    height: 14px;
  }

  .card__title .star--md {
    width: 20px;
    height: 20px;
  }

  .card__title .star--lg {
    width: 24px;
    height: 24px;
  }

  .route-item {
    gap: 20px;
    height: 64px;
    padding: 0 32px;
  }

  .route-item__icon {
    width: 25px;
    height: 25px;
  }

  .route-item__name {
    font-size: 18px;
  }

  .route-item__speed {
    gap: 10px;
  }

  .route-item__speed .icon {
    width: 18px;
    height: 18px;
  }

  .route-item__speed span {
    font-size: 16px;
  }

  .btn {
    height: 40px;
    min-width: 111px;
    font-size: 16px;
  }

  .btn--retest {
    height: 40px;
    gap: 4px;
    font-size: 16px;
  }

  .btn--retest .icon {
    width: 24px;
    height: 24px;
  }

  .card__footer {
    padding: 32px 16px;
  }

  .app-banner {
    gap: 20px;
    height: 100px;
    margin-top: 24px;
    padding: 0 32px;
    border-radius: var(--radius-card-md);
    box-shadow: var(--shadow-card-md);
  }

  .app-banner__icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
  }

  .app-banner__text {
    font-size: 18px;
  }
}
