* { box-sizing: border-box; margin: 0; padding: 0; }

/* 与主站白金主题保持一致；静态部署无需加载主站样式。 */
:root {
  --hub-page: #fff;
  --hub-text: #1a1a1e;
  --hub-muted: #706e68;
  --hub-card: #f8f8f8;
  --hub-border: #f1f1f1;
  --hub-gold: #c8a55d;
  --hub-gold-dark: #a07830;
  --hub-gold-border: #e8d8b8;
  --hub-selected: #fff1cc;
  --hub-track: #efefef;
  --hub-error: #b65c25;
}

html, body {
  min-height: 100%;
  background: var(--hub-page);
  color: var(--hub-text);
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hub-page {
  min-height: 100dvh;
  background: var(--hub-page);
}

.hub-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  width: min(393px, 100%);
  margin: 0 auto;
  padding: 24px 24px 28px;
  overflow: hidden;
}

.hub-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hub-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex: 0 0 32px;
}

.hub-brand-name {
  font-size: 16px;
  font-weight: bold;
  line-height: 32px;
  white-space: nowrap;
}

.hub-language-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-left: auto;
  padding: 8px 10px;
  min-height: 40px;
  border: 1px solid var(--hub-gold-border);
  border-radius: 20px;
  background: var(--hub-page);
  color: var(--hub-gold-dark);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.hub-language-trigger[hidden] { display: none; }
.hub-language-trigger svg { flex-shrink: 0; }
.hub-language-dialog {
  width: min(440px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--hub-gold-border);
  border-radius: 20px;
  background: var(--hub-page);
  color: var(--hub-text);
}
.hub-language-dialog::backdrop { background: rgb(0 0 0 / 30%); }
body:has(.hub-language-dialog[open]) { overflow: hidden; }
.hub-language-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.hub-language-heading h2 { flex: 1; font-size: 20px; overflow-wrap: anywhere; }
.hub-language-close {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: var(--hub-card);
  color: var(--hub-gold-dark);
  font-size: 24px;
  cursor: pointer;
}
.hub-language-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hub-language-option {
  min-height: 48px;
  padding: 10px 8px;
  border: 1px solid var(--hub-gold-border);
  border-radius: 10px;
  background: var(--hub-track);
  color: var(--hub-text);
  font: inherit;
  font-size: 14px;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.hub-language-option[aria-current='page'] { border-color: #cea066; background: var(--hub-selected); color: var(--hub-gold-dark); }
.hub-language-option:hover { background: var(--hub-selected); }
.hub-language-trigger:focus-visible, .hub-language-dialog button:focus-visible, .hub-language-dialog a:focus-visible, .hub-enter:focus-visible, .hub-telegram-action:focus-visible {
  outline: 2px solid var(--hub-gold);
  outline-offset: 3px;
}

.hub-hero {
  position: relative;
  min-height: 231px;
  margin-top: 8px;
}

.hub-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 280px;
  padding-top: 2px;
}

.hub-title {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.hub-title-line { display: block; }

.hub-title-accent { color: var(--hub-gold); }

.hub-subtitle {
  width: 220px;
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--hub-muted);
}

.hub-hero-art {
  position: absolute;
  top: -8px;
  right: -24px;
  width: 302px;
  height: 231px;
  object-fit: cover;
  pointer-events: none;
}

.hub-nav { margin-top: 18px; }

.hub-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.hub-nav-title {
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
}

.hub-route-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  list-style: none;
  max-height: clamp(400px, calc(100dvh - 440px), 640px);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: auto;
  scrollbar-color: #cea066 var(--hub-track);
  padding-right: 10px;
}

.hub-route-list[hidden], .hub-retry[hidden] { display: none; }
.hub-route-list::-webkit-scrollbar { width: 8px; }
.hub-route-list::-webkit-scrollbar-track { background: var(--hub-track); border-radius: 8px; }
.hub-route-list::-webkit-scrollbar-thumb { background: #cea066; border-radius: 8px; }
.hub-route-list::-webkit-scrollbar-thumb:hover { background: #f2d7a2; }
@supports selector(::-webkit-scrollbar) {
  /* 避免标准 scrollbar-color 覆盖 WebKit 样式后退回自动隐藏滚动条。 */
  .hub-route-list { scrollbar-color: auto; }
}
.hub-route-list:focus-visible { outline: 2px solid #cea066; outline-offset: 4px; }
.hub-message { color: var(--hub-muted); padding: 16px 0; font-size: 14px; line-height: 1.6; }
.hub-retry { padding: 8px 16px; border: 1px solid #cea066; border-radius: 8px; background: var(--hub-page); color: var(--hub-gold-dark); cursor: pointer; }
.hub-route-copy { min-width: 0; flex: 1; }
.hub-route-name, .hub-route-host { overflow-wrap: anywhere; }
.hub-route-speed { margin-top: 4px; font-size: 12px; line-height: 18px; color: var(--hub-muted); }
.hub-route-speed[data-state='responded'] { color: var(--hub-gold-dark); }
.hub-route-speed[data-state='failed'], .hub-route-speed[data-state='timeout'] { color: var(--hub-error); }

.hub-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  flex-shrink: 0;
  gap: 12px;
  padding: 12px 16px 12px 24px;
  border-radius: 16px;
  background: var(--hub-card);
  box-shadow: inset 0 0 0 1px var(--hub-border);
}

.hub-route-name {
  font-size: 14px;
  line-height: 20px;
}

.hub-route-host {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--hub-muted);
}

.hub-enter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 69px;
  min-height: 34px;
  padding: 7px 12px;
  border: 0;
  border-radius: 17px;
  background: linear-gradient(99deg, #f2d7a2 0%, #b67b39 50%, #cea066 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-decoration: none;
  flex: 0 0 auto;
}

.hub-enter:hover {
  filter: brightness(1.06);
}

.hub-telegram {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 14px 12px;
  border: 1px solid var(--hub-gold-border);
  border-radius: 16px;
  background: #fffcf5;
}

.hub-telegram[hidden] { display: none; }

.hub-telegram-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--hub-page);
  color: var(--hub-gold-dark);
}

.hub-telegram-copy { min-width: 0; overflow-wrap: anywhere; }
.hub-telegram-copy h2 { font-size: 15px; font-weight: 600; line-height: 22px; }
.hub-telegram-copy p { margin-top: 3px; font-size: 13px; line-height: 1.5; color: var(--hub-muted); }

.hub-telegram-action {
  justify-self: end;
  min-height: 44px;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--hub-gold-border);
  border-radius: 22px;
  background: var(--hub-page);
  color: var(--hub-gold-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  white-space: nowrap;
  text-decoration: none;
}

.hub-telegram-action-full { display: none; }
.hub-telegram-action:hover { filter: brightness(1.06); }

@media (min-width: 768px) {
  .hub-telegram { grid-template-columns: 36px minmax(0, 1fr) auto; padding: 16px 20px; gap: 16px; }
  .hub-telegram-icon { width: 36px; height: 36px; }
  .hub-telegram-action { padding: 10px 16px; }
  .hub-telegram-action-full { display: inline; }
  .hub-telegram-action-short { display: none; }
}

.hub-email {
  width: 337px;
  max-width: 100%;
  margin: 26px auto 0;
  font-size: 11px;
  line-height: 15px;
  text-align: center;
}

.hub-email[hidden] { display: none; }

.hub-email-link {
  color: var(--hub-gold);
  text-decoration: none;
}

.hub-legal {
  margin-top: auto;
  padding-top: 26px;
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
  color: var(--hub-muted);
  overflow-wrap: anywhere;
}

@media (min-width: 768px) {
  .hub-shell {
    width: min(720px, 100%);
    padding: 40px 40px 48px;
  }

  .hub-hero {
    min-height: 260px;
  }

  .hub-hero-copy { max-width: 340px; }

  .hub-title { font-size: 40px; }

  .hub-subtitle {
    width: auto;
    max-width: 280px;
    font-size: 13px;
    line-height: 1.5;
  }

  .hub-hero-art {
    width: 340px;
    height: 260px;
    right: -20px;
  }

  .hub-nav { margin-top: 28px; }

  .hub-email {
    width: auto;
    font-size: 13px;
    line-height: 20px;
  }

  .hub-legal { font-size: 12px; }
}

@media (min-width: 1024px) {
  .hub-shell {
    width: min(1120px, 100%);
    padding: 24px 72px;
    overflow: visible;
  }

  .hub-logo {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .hub-brand-name {
    font-size: 20px;
    line-height: 40px;
  }

  .hub-hero {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) 360px;
    align-items: center;
    gap: 32px;
    min-height: 0;
    margin-top: 8px;
  }

  .hub-hero-copy {
    max-width: none;
    padding-top: 0;
  }

  .hub-title { font-size: 44px; }

  .hub-subtitle {
    max-width: 360px;
    margin-top: 16px;
    font-size: 16px;
  }

  .hub-hero-art {
    position: static;
    width: 360px;
    height: clamp(180px, 26dvh, 240px);
    object-fit: contain;
    justify-self: end;
  }

  .hub-nav {
    max-width: 100%;
    margin-top: 16px;
  }

  .hub-nav-title { font-size: 20px; line-height: 28px; }

  .hub-route {
    min-height: 76px;
    padding: 16px 20px 16px 28px;
  }

  .hub-route-name,
  .hub-route-host { font-size: 16px; line-height: 22px; }

  .hub-route-list { max-height: clamp(200px, calc(100dvh - 400px), 480px); }

  .hub-enter {
    min-width: 84px;
    min-height: 40px;
    font-size: 16px;
  }

  .hub-email {
    max-width: 760px;
    margin-top: 36px;
    font-size: 15px;
    text-align: left;
  }

  .hub-legal {
    max-width: 760px;
    padding-top: 20px;
    font-size: 12px;
    text-align: left;
  }
}

.hub-language-option { display: block; text-decoration: none; }
.hub-language-fallback { margin-top: 16px; font-size: 12px; }
.hub-language-fallback a { color: var(--hub-gold-dark); margin-right: 12px; }
