:root {
  color-scheme: light;
  --bg: #f5f5f5;
  --ink: #161616;
  --muted: #5d5d5d;
  --green: #23ad4e;
  --green-dark: #179340;
  --blue: #4d68ed;
  --panel: rgba(255, 255, 255, 0.92);
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.route-page {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 48px 26px 72px;
}

.route-intro {
  margin: 0 auto 32px;
  text-align: center;
}

.route-intro h1,
.route-intro h2 {
  margin: 0;
  color: #d83242;
  font-weight: 750;
  letter-spacing: 0;
}

.route-intro h1 {
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.25;
}

.route-intro h2 {
  margin-top: 24px;
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.25;
}

.vpn-link {
  display: inline-block;
  margin-top: 22px;
  color: #41178b;
  font-size: clamp(20px, 3.8vw, 30px);
  line-height: 1.35;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.route-list {
  display: grid;
  gap: 28px;
}

.route-card {
  display: flex;
  min-height: 142px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 48px 24px 54px;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}

.route-label {
  font-size: clamp(30px, 4.5vw, 42px);
  font-weight: 650;
  white-space: nowrap;
}

.route-button {
  min-width: 290px;
  padding: 19px 28px;
  border: 0;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  font-size: clamp(24px, 3.7vw, 36px);
  font-weight: 700;
  line-height: 1.2;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.1);
  transition: background 160ms ease, transform 160ms ease;
}

.route-button:hover,
.route-button:focus-visible {
  background: var(--green-dark);
}

.route-button:active {
  transform: translateY(1px);
}

.directory-page {
  min-height: 100vh;
  background: linear-gradient(145deg, #d9e7e7 0%, #f5e2d6 48%, #e3eaf1 100%);
  overflow-x: hidden;
}

.directory-page.has-photo-background {
  background:
    linear-gradient(rgba(246, 207, 154, 0.2), rgba(246, 207, 154, 0.2)),
    url("https://images.unsplash.com/photo-1500534623283-312aade485b7?auto=format&fit=crop&w=1800&q=85")
      center top / cover scroll;
}

.directory-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px 34px 84px;
}

.directory-topbar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.menu-button,
.quick-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(244, 244, 244, 0.78);
  color: #efb642;
  cursor: pointer;
  font-size: 26px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.menu-button {
  width: auto;
  padding: 0 10px;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 35px;
  line-height: 0.8;
  letter-spacing: -3px;
}

.header-clock {
  position: absolute;
  top: 5px;
  left: 50%;
  display: grid;
  justify-items: center;
  color: #fff;
  transform: translateX(-50%);
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.34);
  pointer-events: none;
}

.header-date {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}

.header-time {
  margin-top: 3px;
  font-size: 34px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
}

.site-banner {
  margin: 18px auto 64px;
  padding: 25px 30px 28px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 14% 20%, rgba(255, 255, 255, 0.85) 0 2px, transparent 3px),
    radial-gradient(circle at 72% 28%, rgba(255, 255, 255, 0.8) 0 2px, transparent 3px),
    radial-gradient(circle at 88% 72%, rgba(255, 255, 255, 0.8) 0 2px, transparent 3px),
    #071d3a;
  background-size: 142px 108px, 174px 127px, 196px 146px, auto;
  color: #ff5c39;
  text-align: center;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
}

.site-banner h1 {
  margin: 0;
  font-size: clamp(30px, 4.6vw, 50px);
  font-weight: 500;
  line-height: 1.2;
}

.site-banner p {
  margin: 12px 0 0;
  font-size: clamp(28px, 4.2vw, 46px);
  font-weight: 800;
  line-height: 1.1;
}

.search-form {
  display: grid;
  grid-template-columns: 1fr 180px;
  margin-bottom: 56px;
  overflow: hidden;
  border: 2px solid rgba(77, 104, 237, 0.92);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(46, 70, 166, 0.11);
}

.search-form input {
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 21px 34px;
  color: #242424;
  font-size: 28px;
}

.search-form input::placeholder {
  color: #b5b5b5;
}

.search-form button {
  border: 0;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-size: 44px;
}

.directory-section {
  margin-top: 24px;
  padding: 24px 42px 30px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.directory-section[data-group],
.line-tip-section,
.address-section,
.public-section,
.bottom-banner {
  content-visibility: auto;
  contain-intrinsic-size: 180px;
}

.directory-section h2 {
  margin: 0 0 25px;
  color: #171717;
  font-size: clamp(21px, 2.7vw, 32px);
  font-weight: 650;
  line-height: 1.35;
}

.notice-section {
  padding-top: 24px;
  padding-bottom: 24px;
}

.compact-section {
  min-height: 54px;
  padding: 11px 38px;
  border-radius: 14px;
}

.compact-section h2 {
  margin: 0;
  font-size: clamp(21px, 2.7vw, 32px);
  font-weight: 650;
  line-height: 1.35;
}

.notice-section h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 500;
}

.support-section {
  padding-bottom: 24px;
}

.support-section h2,
.line-tip-section h2,
.address-section h2,
.public-section h2 {
  margin: 0;
  font-size: clamp(18px, 2.5vw, 26px);
  font-weight: 500;
  line-height: 1.45;
}

.support-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  margin-top: 26px;
}

.line-tip-section,
.address-section,
.public-section {
  min-height: 66px;
  padding-top: 19px;
  padding-bottom: 19px;
}

.address-section h2 {
  font-weight: 600;
}

.public-section {
  margin-top: 20px;
}

.bottom-banner {
  margin-top: 48px;
  margin-bottom: 0;
  padding-top: 25px;
  padding-bottom: 25px;
}

.bottom-banner h1 {
  font-size: clamp(24px, 3.7vw, 40px);
}

.bottom-banner p {
  margin-top: 8px;
  font-size: clamp(25px, 3.6vw, 40px);
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  column-gap: 28px;
  row-gap: 27px;
}

.site-link {
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 0;
  color: #d53039;
  text-align: center;
  cursor: pointer;
}

.site-link:hover .site-icon {
  transform: translateY(-2px);
}

.site-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #e1e1e1;
  border-radius: 10px;
  background: linear-gradient(145deg, #fff, #f5f5f5);
  color: #2949b4;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.1);
  transition: transform 160ms ease;
}

.site-icon img {
  width: 100%;
  height: 100%;
  padding: 3px;
  object-fit: contain;
}

.site-icon-fallback {
  font-size: inherit;
  font-weight: inherit;
}

.site-name {
  overflow: hidden;
  max-width: 100%;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-note {
  margin: 38px 0 0;
  color: #e12734;
  font-size: clamp(18px, 2.8vw, 28px);
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 15px;
  border-radius: 10px;
  background: rgba(20, 20, 20, 0.84);
  color: #fff;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 700px) {
  .route-page {
    padding: 78px 18px 46px;
  }

  .route-intro {
    margin-bottom: 36px;
  }

  .route-intro h2 {
    margin-top: 24px;
  }

  .vpn-link {
    margin-top: 24px;
  }

  .route-list {
    gap: 28px;
  }

  .route-card {
    min-height: 156px;
    padding: 22px 30px;
    border-radius: 20px;
  }

  .route-label {
    font-size: 31px;
  }

  .route-button {
    min-width: 0;
    flex: 0 1 48%;
    padding: 19px 16px;
    font-size: 26px;
  }

  .directory-page {
    background-attachment: scroll;
  }

  .directory-shell {
    padding: 14px 16px 58px;
  }

  .directory-topbar {
    height: 66px;
  }

  .site-banner {
    margin: 16px 18px 44px;
    padding: 24px 16px 28px;
    border-radius: 24px;
  }

  .search-form {
    grid-template-columns: 1fr 100px;
    margin-bottom: 34px;
    border-radius: 18px;
  }

  .search-form input {
    padding: 17px 22px;
    font-size: 20px;
  }

  .search-form button {
    font-size: 32px;
  }

  .directory-section {
    margin-top: 24px;
    padding: 20px 18px 24px;
    border-radius: 18px;
  }

  .directory-section h2 {
    margin-bottom: 22px;
    font-size: 17px;
  }

  .compact-section {
    min-height: 48px;
    padding: 8px 22px;
    border-radius: 12px;
  }

  .compact-section h2 {
    font-size: 17px;
    font-weight: 650;
    line-height: 1.35;
  }

  .support-section h2,
  .line-tip-section h2,
  .address-section h2,
  .public-section h2 {
    font-size: 16px;
  }

  .support-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 22px;
  }

  .line-tip-section,
  .address-section,
  .public-section {
    min-height: 60px;
    padding-top: 17px;
    padding-bottom: 17px;
  }

  .address-section h2 {
    white-space: nowrap;
    font-size: 13px;
  }

  .bottom-banner {
    margin-top: 34px;
    padding-top: 22px;
    padding-bottom: 24px;
  }

  .directory-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 18px;
    row-gap: 26px;
  }

  .site-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 15px;
  }

  .site-name {
    font-size: 13px;
  }

  .header-date {
    font-size: 13px;
  }

  .header-time {
    font-size: 28px;
  }
}

@media (max-width: 390px) {
  .route-card {
    padding-inline: 21px;
  }

  .route-label {
    font-size: 28px;
  }

  .route-button {
    font-size: 22px;
  }

  .directory-section {
    padding-inline: 14px;
  }

  .site-name {
    font-size: 13px;
  }
}
