:root {
  --shell-max: 520px;
  --page-bg: #070d15;
  --shell-bg: #091420;
  --panel-bg: #111c28;
  --panel-border: #293542;
  --route-border: #18483f;
  --tool-border: #514620;
  --text: #eef4ff;
  --text-soft: #91a4b9;
  --text-muted: #4d6276;
  --green: #2bbd8c;
  --green-bright: #12d993;
  --gold: #d6ae19;
  --orange: #ff5a08;
  --danger: #ff555a;
  --warning: #d5ad13;
  --blue: #2654e8;
  color: var(--text);
  background: var(--page-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--page-bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background: var(--page-bg);
}

[hidden] {
  display: none !important;
}

ul,
h1,
h2,
h3,
p {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

svg {
  display: block;
}

.page-shell {
  width: min(100%, var(--shell-max));
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--shell-bg);
  border-inline: 1px solid rgba(89, 107, 125, .2);
  box-shadow: 0 0 40px rgba(0, 0, 0, .22);
}

.redirect-loader {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  padding: max(24px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  overflow: auto;
  background:
    radial-gradient(circle at 50% 36%, rgba(43, 189, 140, .13), transparent 34%),
    var(--page-bg);
  place-items: center;
}

.redirect-loader__panel {
  width: min(100%, 360px);
  max-width: 360px;
  min-width: 0;
  padding: 34px 24px 30px;
  text-align: center;
  background: linear-gradient(145deg, rgba(17, 28, 40, .98), rgba(10, 21, 32, .98));
  border: 1px solid rgba(43, 189, 140, .26);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .38);
}

.redirect-loader__mark {
  display: grid;
  width: 62px;
  height: 62px;
  margin: 0 auto 24px;
  background: rgba(43, 189, 140, .09);
  border: 1px solid rgba(43, 189, 140, .28);
  border-radius: 50%;
  place-items: center;
}

.redirect-loader__spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(145, 164, 185, .24);
  border-top-color: var(--green-bright);
  border-radius: 50%;
  animation: redirect-loader-spin .8s linear infinite;
}

.redirect-loader h1 {
  color: var(--text);
  font-size: clamp(20px, 6vw, 24px);
  font-weight: 700;
  line-height: 1.35;
}

.redirect-loader p {
  margin-top: 10px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
}

.redirect-loader progress {
  display: block;
  width: 100%;
  height: 10px;
  margin-top: 28px;
  overflow: hidden;
  appearance: none;
  background: #172533;
  border: 0;
  border-radius: 999px;
}

.redirect-loader progress::-webkit-progress-bar {
  background: #172533;
  border-radius: 999px;
}

.redirect-loader progress::-webkit-progress-value {
  background: linear-gradient(90deg, #159c70, var(--green-bright));
  border-radius: 999px;
  transition: width .18s ease;
}

.redirect-loader progress::-moz-progress-bar {
  background: linear-gradient(90deg, #159c70, var(--green-bright));
  border-radius: 999px;
  transition: width .18s ease;
}

.redirect-loader__meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

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

.topbar {
  display: flex;
  align-items: center;
  min-height: 53px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(94, 111, 129, .22);
}

.brand-mark {
  display: grid;
  width: 26px;
  height: 26px;
  margin-right: 9px;
  color: #fff;
  background: #37a87d;
  border-radius: 7px;
  place-items: center;
}

.brand-mark svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.topbar h1 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -.2px;
}

.page-content {
  padding: 25px 16px 30px;
}

.content-section + .content-section {
  margin-top: 30px;
}

.section-title {
  display: flex;
  align-items: center;
  min-height: 22px;
  margin-bottom: 18px;
  color: var(--text-soft);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: .3px;
}

.section-title::before {
  width: 3px;
  height: 14px;
  margin-right: 10px;
  content: "";
  background: linear-gradient(180deg, var(--gold), var(--green));
  border-radius: 3px;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.route-empty {
  grid-column: 1 / -1;
  padding: 24px 16px;
  color: var(--text-muted);
  text-align: center;
  background: rgba(17, 28, 40, .72);
  border: 1px dashed var(--panel-border);
  border-radius: 17px;
}

.route-card {
  position: relative;
  min-width: 0;
  min-height: 87px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(20, 34, 47, .98), rgba(14, 25, 37, .98));
  border: 1px solid var(--route-border);
  border-radius: 17px;
}

.route-card__link {
  display: block;
  min-height: 85px;
  padding: 20px 16px 15px;
  color: inherit;
  border-radius: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.route-card__link:hover:not([aria-disabled="true"]) {
  background: rgba(43, 189, 140, .05);
}

.route-card__link:focus-visible {
  outline: 2px solid var(--green-bright);
  outline-offset: -3px;
}

.route-card__link[aria-disabled="true"] {
  cursor: default;
  pointer-events: none;
}

.route-card__head {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 19px;
  gap: 7px;
}

.route-card__name {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-badge {
  position: static;
  flex: 0 0 auto;
  padding: 5px 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  border-radius: 999px;
}

.route-badge--red {
  background: #d94b4f;
  box-shadow: 0 0 12px rgba(217, 75, 79, .55);
}

.route-badge--yellow {
  color: #171100;
  background: #d6ae19;
  box-shadow: 0 0 12px rgba(214, 174, 25, .45);
}

.route-badge--green {
  background: #159c70;
  box-shadow: 0 0 12px rgba(21, 156, 112, .48);
}

.route-badge--blue {
  background: #356ad8;
  box-shadow: 0 0 12px rgba(53, 106, 216, .5);
}

.route-badge--gray {
  background: #526273;
  box-shadow: 0 0 12px rgba(82, 98, 115, .45);
}

.route-card__status {
  display: flex;
  align-items: flex-end;
  min-width: 0;
  margin-top: 13px;
}

.route-card__latency {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 17px;
  white-space: nowrap;
}

.route-card__latency--danger {
  color: var(--danger);
}

.route-card__latency--good {
  color: var(--green-bright);
}

.route-card__latency--warning {
  color: var(--warning);
}

.signal {
  display: flex;
  align-items: flex-end;
  flex: 0 0 auto;
  height: 14px;
  margin: 0 0 1px 10px;
  gap: 3px;
}

.signal i {
  display: block;
  width: 4px;
  background: #25313f;
  border-radius: 1px 1px 0 0;
}

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

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

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

.signal i:nth-child(4) {
  height: 14px;
}

.signal--danger i:first-child {
  background: var(--danger);
}

.signal--good i {
  background: var(--green-bright);
}

.signal--warning i:nth-child(-n + 2) {
  background: var(--warning);
}

.route-card__arrow {
  margin: -3px 0 -2px auto;
  color: #27936e;
  font-family: Arial, sans-serif;
  font-size: 27px;
  font-weight: 300;
  line-height: 20px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tool-card {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 66px;
  padding: 14px 13px;
  background: linear-gradient(145deg, rgba(18, 29, 41, .98), rgba(14, 24, 35, .98));
  border: 1px solid var(--tool-border);
  border-radius: 17px;
}

.tool-card__link {
  display: flex;
  align-items: center;
  align-self: stretch;
  width: calc(100% + 26px);
  margin: -14px -13px;
  padding: 14px 13px;
  color: inherit;
  border-radius: inherit;
  text-decoration: none;
}

.tool-card__link:hover {
  background: rgba(201, 162, 39, .06);
}

.tool-card__link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -3px;
}

.tool-card__icon {
  display: grid;
  flex: 0 0 auto;
  width: 37px;
  height: 37px;
  margin-right: 10px;
  color: var(--gold);
  background: rgba(201, 162, 39, .1);
  border: 1px solid rgba(201, 162, 39, .28);
  border-radius: 11px;
  place-items: center;
}

.tool-card__icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.tool-card strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navigation-section .section-title {
  margin-bottom: 17px;
}

.nav-group + .nav-group {
  margin-top: 22px;
}

.nav-group h3 {
  margin: 0 0 12px 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .4px;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.nav-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 76px;
  padding: 12px 5px 10px;
  color: var(--text-soft);
  background: #121d29;
  border: 1px solid var(--panel-border);
  border-radius: 13px;
  flex-direction: column;
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .16s ease, background-color .16s ease;
}

.nav-card:hover {
  background: #162331;
  border-color: #3a4b5d;
}

.nav-card:focus-visible {
  outline: 2px solid var(--green-bright);
  outline-offset: 2px;
}

.nav-card > span:last-child {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-card__logo {
  display: grid;
  width: 32px;
  height: 32px;
  margin-bottom: 7px;
  color: #fff;
  font-size: 15px;
  font-weight: 750;
  line-height: 1;
  border-radius: 9px;
  place-items: center;
}

.logo--baidu { background: #3034e7; }
.logo--sina { background: #f2051a; }
.logo--netease { background: #df0907; }
.logo--toutiao { background: #ff2f57; }
.logo--weibo { background: #f31335; }
.logo--zhihu { background: #1087ed; }
.logo--redbook { background: #ff2449; }
.logo--douyin { background: #111522; }
.logo--taobao { background: #ff5b0a; }
.logo--jd { background: #ef261c; }
.logo--pdd { background: #ed3027; }
.logo--tmall { background: #ff0735; }
.logo--iqiyi { background: #00be06; }
.logo--youku { background: #2698ef; }
.logo--bilibili { background: #f46b95; }
.logo--tencent { background: #2685f5; }
.logo--alipay { background: #1d7df4; }
.logo--eastmoney { background: #d73b2d; }
.logo--xueqiu { background: #f5a51d; }
.logo--ths { background: #eb2f32; }
.logo--meituan { background: #f4a51d; }
.logo--eleme { background: #1d91ed; }
.logo--rail { background: #2078c9; }
.logo--map { background: #3537e9; }

.page-footer {
  padding: 20px 16px max(20px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(94, 111, 129, .22);
  background: linear-gradient(180deg, rgba(17, 27, 39, .8), rgba(8, 17, 28, .96));
}

.search-form {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 4px 5px 4px 15px;
  color: #52687d;
  background: #111c28;
  border: 1px solid #303c4b;
  border-radius: 999px;
}

.search-form:focus-within {
  border-color: #426079;
  box-shadow: 0 0 0 2px rgba(43, 189, 140, .14);
}

.search-form__icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-right: 10px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.search-form__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  color: var(--text-soft);
  font: inherit;
  font-size: 16px;
  line-height: 34px;
  background: transparent;
  border: 0;
  outline: 0;
  appearance: none;
}

.search-form__input::placeholder {
  color: #52687d;
  opacity: 1;
}

.search-form__action {
  display: grid;
  flex: 0 0 auto;
  min-width: 77px;
  height: 34px;
  margin-left: auto;
  padding: 0 14px;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  background: var(--blue);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
}

.search-form__action:hover {
  background: #3262f0;
}

.search-form__action:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.page-footer p {
  margin-top: 25px;
  color: #4a6074;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.copy-toast {
  position: fixed;
  z-index: 10;
  right: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 10px 16px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  background: rgba(8, 16, 25, .94);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .35);
  transform: translateX(50%);
}

@media (max-width: 359px) {
  .topbar,
  .page-content,
  .page-footer {
    padding-right: 12px;
    padding-left: 12px;
  }

  .route-grid,
  .tool-grid {
    gap: 9px;
  }

  .nav-grid {
    gap: 6px;
  }

  .route-card__link {
    padding-right: 12px;
    padding-left: 12px;
  }

  .route-card__name,
  .tool-card strong {
    font-size: 13px;
  }

  .signal {
    margin-left: 7px;
    gap: 2px;
  }

  .nav-card {
    padding-right: 3px;
    padding-left: 3px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .redirect-loader__spinner {
    animation: none;
  }

  .redirect-loader progress::-webkit-progress-value,
  .redirect-loader progress::-moz-progress-bar {
    transition: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    transition-delay: 0ms !important;
  }
}
