:root { font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif; color: #535d6b; background: #eef2f6; --blue: #276bb1; --light-blue: #6f94b9; --border: #dce3ea; }
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
button, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 3px solid #164e94; outline-offset: 4px; }
.wrap { width: min(1200px, calc(100% - 56px)); margin: auto; }
.skip-link { position: absolute; top: -100px; z-index: 3; background: white; padding: 14px; }
.skip-link:focus { top: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.header { background: linear-gradient(170deg, #f6fbff 0%, #e0edf8 45%, #b5cfe5 100%); border-bottom: 1px solid #cbdbea; position: relative; overflow: hidden; }
.header::before, .header::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(165deg, transparent 40%, #ffffff26 40%, #ffffff06 67%, transparent 67%); }
.header::after { transform: scaleX(-1); opacity: .7; }
.header-inner { position: relative; z-index: 1; min-height: 94px; display: flex; align-items: center; justify-content: space-between; }
h1 { margin: 0; line-height: 0; }
.logo { display: block; width: 164px; height: auto; }
.header-actions { align-self: flex-end; padding-bottom: 4px; }
.header-actions>div { display: flex; gap: 12px; }
.header-actions button { border: 0; background: transparent; color: #325c85; min-height: 44px; padding: 8px 4px; font-size: 15px; }
.header-actions button:hover { color: #164e94; }
.header-actions button span { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; color: white; background: #5687b4; font-size: 11px; }
.mobile-title { display: none; }
main { display: flex; flex-direction: column; }
.route-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin: 34px 8px 20px; }
.route-card { display: flex; flex-direction: column; background: white; border: 2px solid #e2e8ef; border-radius: 8px; overflow: hidden; position: relative; transition: border-color .15s; }
.route-card:hover { border-color: #82a9d0; }
.route-name { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 84px; font-size: 19px; white-space: nowrap; }
.route-name::before { content: "›"; display: inline-grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: #78828d; color: white; font-size: 26px; line-height: 1; }
.latency { display: block; text-align: center; min-height: 45px; padding: 7px 8px; background: var(--light-blue); color: white; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.latency.pending, .latency.failed { font-size: 21px; padding-top: 10px; }
.route-card.best { border-color: var(--blue); }
.best .latency, .best .route-name::before { background: var(--blue); }
.badge { position: absolute; bottom: 14px; right: 9px; color: white; font-size: 11px; }
.notice { display: flex; align-items: center; gap: 15px; background: #e4edf5; border-radius: 6px; padding: 0 12px; min-height: 36px; margin-bottom: 22px; font-size: 13px; color: #566c83; }
.notice a { white-space: nowrap; }
.notice a:hover { text-decoration: underline; }
#recheck { margin-left: auto; background: none; border: none; color: var(--blue); padding: 10px 0 10px 8px; min-height: 44px; white-space: nowrap; font-size: 12px; }
#recheck:disabled { opacity: .55; cursor: wait; }
.directory { display: grid; grid-template-columns: 1.85fr 1fr; gap: 12px; }
.link-panel { background: #fff; border-radius: 7px; padding: 12px 26px 20px; min-width: 0; }
#news { grid-column: 2; grid-row: 1 / 4; }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
h2 { margin: 0; font-size: 21px; font-weight: 600; line-height: 1.5; }
.more { background: none; border: none; min-height: 44px; padding: 6px 0 6px 10px; color: #535d6b; font-size: 15px; }
.more:hover { color: var(--blue); }
.site-links { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: 12px; row-gap: 5px; }
.site-links a { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; white-space: nowrap; }
.site-links a:hover { color: var(--blue); }
.site-links img { flex: 0 0 20px; width: 20px; height: 20px; object-fit: contain; }
#news .site-links { grid-template-columns: repeat(2, minmax(0, 1fr)); height: calc(100% - 55px); gap: 8px; }
#news .site-links a { flex-direction: column; justify-content: center; gap: 6px; }
.category-tabs { display: none; }
.measurement-note { color: #7c8591; font-size: 11px; text-align: center; margin: 17px 0; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 24px 12px; }
dialog { color: #435367; border: 1px solid var(--border); border-radius: 10px; padding: 20px 24px 24px; max-width: min(580px, calc(100% - 32px)); max-height: 85vh; }
dialog::backdrop { background: #172b4680; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; position: sticky; top: -20px; background: white; z-index: 1; }
.dialog-header h2 { font-size: 19px; }
.close-dialog { width: 44px; height: 44px; font-size: 27px; background: none; border: none; color: #667788; }
#help-text { line-height: 1.9; font-size: 15px; max-width: 420px; }
.primary-button { border: none; border-radius: 5px; background: var(--blue); color: white; min-height: 44px; padding: 10px 16px; }
#all-sites { width: 800px; max-width: calc(100% - 32px); }
#all-site-links h3 { font-size: 17px; border-bottom: 1px solid var(--border); padding-bottom: 9px; margin-top: 24px; }
#all-site-links .site-links { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); width: max-content; background: #203853; color: white; padding: 13px 20px; border-radius: 6px; font-size: 13px; z-index: 10; }
@media (min-width: 701px) and (max-width: 1000px) {
  .wrap { width: calc(100% - 32px); }
  .route-grid { gap: 10px; margin-left: 0; margin-right: 0; }
  .route-name { font-size: 16px; gap: 5px; }
  .latency { font-size: 22px; }
  .badge { bottom: 4px; right: 4px; font-size: 9px; }
  .link-panel { padding-left: 15px; padding-right: 15px; }
  .site-links { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .site-links a { font-size: 13px; gap: 6px; }
  .notice { gap: 10px; font-size: 11px; }
}
@media (max-width: 700px) {
  .wrap { width: calc(100% - 24px); }
  .header-inner { min-height: 143px; display: block; padding-top: 6px; }
  .logo { width: 165px; margin: 0 auto; }
  .header-actions { display: flex; justify-content: space-between; align-items: center; padding-bottom: 0; }
  .mobile-title { display: block; color: #325c85; font-size: 15px; }
  .header-actions>div { gap: 10px; }
  .header-actions button { font-size: 14px; padding-left: 0; padding-right: 0; }
  .notice { order: -1; margin: 0 -12px 14px; padding: 7px 12px; border-radius: 0; gap: 4px 10px; flex-wrap: wrap; font-size: 11px; }
  .notice>span:first-child { display: none; }
  #recheck { min-height: 28px; padding: 4px 0; font-size: 11px; }
  .route-grid { margin: 0 0 12px; background: white; padding: 23px 18px; border-radius: 7px; grid-template-columns: 1fr; gap: 17px; }
  .route-card { flex-direction: row; align-items: center; justify-content: space-between; min-height: 54px; border-radius: 30px; padding: 9px 44px 9px 17px; overflow: visible; }
  .route-card::after { content: "›"; display: inline-grid; place-items: center; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 25px; height: 25px; border-radius: 50%; font-size: 27px; color: white; background: var(--light-blue); line-height: 1; }
  .route-name { min-height: 0; font-size: 14px; }
  .route-name::before { display: none; }
  .latency { min-height: 0; background: none; color: #586777; font-size: 22px; padding: 0; white-space: nowrap; }
  .latency.pending, .latency.failed { padding: 0; font-size: 17px; }
  .best .latency { background: none; color: var(--blue); }
  .best::after { background: var(--blue); }
  .badge { top: -7px; bottom: auto; right: 43px; background: white; padding: 0 4px; font-size: 10px; color: var(--blue); }
  .category-tabs { display: grid; grid-template-columns: repeat(4, 1fr); background: #e0e9f3; border-radius: 6px; padding: 3px; gap: 2px; margin-bottom: 12px; }
  .category-tabs button { font-size: 13px; border: none; min-height: 44px; padding: 7px 0; border-radius: 5px; color: #496681; background: none; }
  .category-tabs button[aria-pressed="true"] { background: var(--blue); color: white; }
  .directory { display: block; }
  .js .link-panel:not(.active) { display: none; }
  .link-panel { padding: 0 14px 18px; }
  .panel-header { justify-content: flex-end; margin-bottom: 4px; }
  .panel-header h2 { display: none; }
  .more { font-size: 14px; }
  .site-links, #news .site-links { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px 5px; height: auto; }
  .site-links a, #news .site-links a { flex-direction: column; justify-content: center; gap: 7px; min-height: 55px; font-size: 13px; }
  .site-links img { width: 20px; height: 20px; }
  #all-site-links .site-links { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
