:root {
  --page-bg: #05ad8d;
  --panel-bg: #ffffff;
  --brand: #05ad8d;
  --brand-dark: #039c80;
  --text: #263238;
  --muted: #079b83;
  --line: #e7ecea;
  --shadow: 0 22px 70px rgba(0, 86, 73, 0.18);
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.15), transparent 24%),
    radial-gradient(circle at 82% 12%, rgba(255, 255, 255, 0.1), transparent 20%),
    var(--page-bg);
}

button,
input,
textarea {
  font: inherit;
}

.site-stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: 92%;
  max-width: 550px;
  min-width: 0;
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.site-title {
  margin: 0 0 28px;
  color: #ffffff;
  font-size: clamp(32px, 4vw, 41px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: 0;
  text-align: center;
}

.guide-panel {
  width: 100%;
  min-width: 0;
  padding: 24px;
  border-radius: 8px;
  background: var(--panel-bg);
  box-shadow: var(--shadow);
}

.bookmark-tip {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #087d6c;
  background: #edf9f6;
  box-shadow: inset 0 0 0 1px rgba(5, 173, 141, 0.12);
  font-size: 15px;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bookmark-tip span {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.entry-domain {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 13px;
  border-bottom: 1px solid var(--line);
}

.entry-label {
  color: #4b5755;
  font-size: 14px;
}

.entry-domain strong {
  min-width: 0;
  color: var(--brand);
  font-size: 15px;
  font-weight: 400;
  overflow-wrap: anywhere;
  word-break: break-all;
  text-align: right;
}

.link-list {
  width: 100%;
}

.link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  gap: 14px;
  align-items: center;
  min-height: 88px;
  padding: 14px 0 14px 16px;
  border-bottom: 1px solid var(--line);
}

.link-copy {
  min-width: 0;
}

.line-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-bottom: 7px;
}

.line-heading h2 {
  flex: 0 0 auto;
  margin: 0;
  color: #263238;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.3;
}

.line-note {
  min-width: 0;
  color: #7b8c89;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.latency-badge {
  flex: 0 0 auto;
  min-width: 52px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #70817e;
  background: #edf5f3;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
}

.latency-badge.is-good {
  color: #087d6c;
  background: #e6f8f3;
}

.latency-badge.is-ok {
  color: #8a6a08;
  background: #fff8d9;
}

.latency-badge.is-slow,
.latency-badge.is-bad {
  color: #a64235;
  background: #fff0ee;
}

.link-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.route-tip {
  margin: 14px 0 0;
  padding: 11px 14px;
  border-radius: 6px;
  color: #60706d;
  background: #f3faf8;
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
  overflow-wrap: anywhere;
}

.action-btn {
  width: 78px;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 2px 4px rgba(0, 94, 79, 0.18);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.action-btn:hover {
  background: var(--brand-dark);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24), 0 6px 16px rgba(0, 94, 79, 0.22);
  transform: translateY(-1px);
}

.action-btn:active {
  transform: translateY(0);
}

.action-btn:focus-visible {
  outline: 3px solid rgba(5, 173, 141, 0.35);
  outline-offset: 3px;
}

.site-footer {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-top: 32px;
  color: #ffffff;
  font-size: clamp(15px, 1.6vw, 18px);
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-shadow: 0 1px 10px rgba(0, 87, 74, 0.18);
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 3;
  max-width: min(90vw, 520px);
  padding: 12px 18px;
  border-radius: 8px;
  color: #ffffff;
  background: rgba(20, 35, 32, 0.92);
  font-size: 16px;
  line-height: 1.45;
  text-align: center;
  transform: translate(-50%, 24px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (max-width: 720px) {
  .page-shell {
    width: 94%;
    max-width: 560px;
    padding-top: 28px;
  }

  .site-title {
    font-size: 36px;
    margin-bottom: 26px;
  }

  .guide-panel {
    padding: 16px;
  }

  .bookmark-tip {
    min-height: 40px;
    padding: 9px 11px;
    font-size: 14px;
  }

  .entry-domain {
    display: flex;
    align-items: center;
    padding: 14px 4px 13px;
  }

  .entry-label {
    display: inline;
    flex: 0 0 auto;
    margin-bottom: 0;
  }

  .entry-domain strong {
    display: inline;
    text-align: right;
    font-size: 14px;
  }

  .link-row {
    grid-template-columns: minmax(0, 1fr) 70px;
    gap: 10px;
    min-height: 0;
    padding: 15px 4px;
  }

  .action-btn {
    width: 70px;
    min-height: 42px;
    font-size: 16px;
  }

  .line-heading {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 8px;
    row-gap: 2px;
    align-items: center;
    margin-bottom: 6px;
  }

  .line-heading h2 {
    grid-column: 1;
    grid-row: 1;
    font-size: 17px;
  }

  .line-note {
    grid-column: 1 / -1;
    grid-row: 2;
    display: block;
    font-size: 12px;
  }

  .latency-badge {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    min-width: 48px;
    padding: 2px 6px;
  }

  .link-copy p {
    font-size: 14px;
  }

  .route-tip {
    margin-top: 12px;
    padding: 10px 11px;
    font-size: 12px;
    text-align: left;
  }

  .site-footer {
    margin-top: 32px;
    padding: 0 8px;
    font-size: 15px;
  }
}

@media (max-width: 380px) {
  .guide-panel {
    padding: 12px;
  }

  .link-row {
    grid-template-columns: minmax(0, 1fr) 64px;
    gap: 8px;
  }

  .action-btn {
    width: 64px;
    font-size: 15px;
  }
}
