.visitor-footprints {
  --vf-font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", Inter, system-ui, sans-serif;
  --vf-font-numeric: Inter, "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
  --vf-ink: #18201c;
  --vf-muted: #68716c;
  --vf-faint: #8c958f;
  --vf-accent: #3f6b57;
  --vf-accent-deep: #2e5442;
  --vf-accent-soft: rgba(63, 107, 87, 0.1);
  --vf-accent-pale: rgba(63, 107, 87, 0.055);
  --vf-line: rgba(27, 33, 30, 0.12);
  --vf-line-strong: rgba(27, 33, 30, 0.2);
  --vf-paper: rgba(250, 249, 246, 0.82);
  --vf-panel: rgba(255, 255, 255, 0.48);
  position: relative;
  isolation: isolate;
  margin: clamp(58px, 8vw, 92px) 0 18px;
  padding: clamp(30px, 4.6vw, 54px) clamp(22px, 4.6vw, 52px) clamp(26px, 4vw, 44px);
  overflow: hidden;
  border-top: 1px solid var(--vf-line-strong);
  border-bottom: 1px solid var(--vf-line);
  background:
    radial-gradient(ellipse at 4% 8%, rgba(63, 107, 87, 0.075), transparent 34%),
    radial-gradient(ellipse at 92% 94%, rgba(63, 107, 87, 0.045), transparent 30%);
  color: var(--vf-ink);
  font-family: var(--vf-font-sans);
  font-synthesis: none;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.visitor-footprints::before {
  position: absolute;
  z-index: -1;
  top: -80px;
  right: -54px;
  width: 250px;
  height: 210px;
  border-radius: 48% 52% 58% 42%;
  background: radial-gradient(ellipse, rgba(63, 107, 87, 0.065), transparent 67%);
  filter: blur(9px);
  content: "";
  pointer-events: none;
  transform: rotate(-12deg);
}

.visitor-footprints,
.visitor-footprints * {
  box-sizing: border-box;
}

.vf-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
  margin-bottom: 30px;
}

.vf-kicker {
  margin: 0 0 10px !important;
  color: var(--vf-accent) !important;
  font-family: var(--vf-font-sans) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.vf-title {
  margin: 0 !important;
  color: var(--vf-ink) !important;
  font-family: var(--vf-font-sans) !important;
  font-size: clamp(28px, 3.8vw, 42px) !important;
  font-weight: 700 !important;
  line-height: 1.18 !important;
  letter-spacing: -0.035em;
}

.vf-subtitle {
  max-width: 620px;
  margin: 12px 0 0 !important;
  color: var(--vf-muted) !important;
  font-family: var(--vf-font-sans) !important;
  font-size: 14.5px !important;
  font-weight: 400 !important;
  line-height: 1.75 !important;
}

.vf-periods {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--vf-line);
  border-radius: 999px;
  background: var(--vf-panel);
}

.vf-period {
  min-width: 56px;
  min-height: 32px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--vf-muted);
  font-family: var(--vf-font-sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
}

.vf-period[aria-selected="true"] {
  background: var(--vf-accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(46, 84, 66, 0.18);
}

.vf-period:focus-visible {
  outline: 2px solid var(--vf-accent);
  outline-offset: 2px;
}

.vf-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 30px;
  padding: 0;
  border-top: 1px solid var(--vf-line);
  border-bottom: 1px solid var(--vf-line);
}

.vf-metric {
  min-width: 0;
  padding: 18px 18px 17px;
}

.vf-metric:first-child {
  padding-left: 0;
}

.vf-metric + .vf-metric {
  border-left: 1px solid var(--vf-line);
}

.vf-metric dt {
  margin: 0 0 4px;
  color: var(--vf-muted);
  font-family: var(--vf-font-sans);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.vf-metric dd {
  overflow: hidden;
  margin: 0;
  color: var(--vf-ink);
  font-family: var(--vf-font-numeric);
  font-size: clamp(22px, 2.6vw, 31px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vf-content {
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(220px, 0.72fr);
  gap: clamp(24px, 3.4vw, 42px);
  align-items: start;
}

.vf-map-card,
.vf-ranking {
  min-width: 0;
}

.vf-map-card {
  display: grid;
  grid-template-rows: auto auto;
  gap: 12px;
}

.vf-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.vf-panel-title {
  margin: 0 !important;
  color: var(--vf-ink) !important;
  font-family: var(--vf-font-sans) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  letter-spacing: -0.01em;
}

.vf-panel-note {
  margin: 0 !important;
  color: var(--vf-faint) !important;
  font-family: var(--vf-font-sans) !important;
  font-size: 10.5px !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  white-space: nowrap;
}

.vf-map-plot {
  position: relative;
  min-height: 0;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border: 1px solid var(--vf-line);
  border-radius: 2px;
  background:
    linear-gradient(rgba(63, 107, 87, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 107, 87, 0.035) 1px, transparent 1px),
    var(--vf-paper);
  background-size: 12.5% 25%, 12.5% 25%, auto;
}

.vf-map-base,
.vf-map-points {
  position: absolute;
  inset: 4% 3.4%;
  width: 93.2%;
  height: 92%;
}

.vf-map-base {
  display: block;
  object-fit: fill;
  opacity: 0.42;
  filter: grayscale(1) sepia(0.24) hue-rotate(92deg) saturate(0.78) contrast(0.84);
}

.vf-map-points {
  z-index: 2;
  overflow: visible;
}

.vf-map-dot {
  outline: none;
  cursor: default;
}

.vf-map-dot__halo {
  fill: rgba(63, 107, 87, 0.1);
  stroke: rgba(63, 107, 87, 0.2);
  stroke-width: 0.8;
}

.vf-map-dot__core {
  fill: var(--vf-accent);
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 1.3;
}

.vf-map-dot:is(:hover, :focus) .vf-map-dot__halo {
  fill: rgba(63, 107, 87, 0.19);
  stroke: rgba(46, 84, 66, 0.48);
}

.vf-map-dot:is(:hover, :focus) .vf-map-dot__core {
  fill: var(--vf-accent-deep);
}

.vf-map-empty {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 24px;
  background: rgba(250, 249, 246, 0.58);
  color: var(--vf-muted);
  font-family: var(--vf-font-sans);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
}

.vf-map-empty[hidden] {
  display: none;
}

.vf-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 118px;
  padding: 9px 11px;
  border: 1px solid rgba(46, 84, 66, 0.22);
  border-radius: 3px;
  background: rgba(250, 249, 246, 0.96);
  color: var(--vf-ink);
  font-family: var(--vf-font-sans);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.45;
  box-shadow: 0 8px 26px rgba(27, 33, 30, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
  transition: opacity 120ms ease;
}

.vf-tooltip strong {
  display: block;
  margin-bottom: 2px;
  font-size: 12.5px;
  font-weight: 700;
}

.vf-tooltip.is-visible {
  opacity: 1;
}

.vf-ranking {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

.vf-ranking-list {
  display: grid;
  align-content: start;
  gap: 0;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--vf-line);
  list-style: none;
}

.vf-rank {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  grid-template-rows: auto 2px;
  align-items: center;
  gap: 9px 10px;
  min-height: 54px;
  padding: 10px 0 9px;
  border-bottom: 1px solid var(--vf-line);
}

.vf-rank__index {
  color: var(--vf-faint);
  font-family: var(--vf-font-numeric);
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.vf-rank__country {
  overflow: hidden;
  color: var(--vf-ink);
  font-family: var(--vf-font-sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vf-rank__value {
  color: var(--vf-ink);
  font-family: var(--vf-font-numeric);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.vf-rank__track {
  grid-column: 2 / 4;
  position: relative;
  height: 2px;
  overflow: hidden;
  background: rgba(63, 107, 87, 0.09);
}

.vf-rank__track::after {
  display: block;
  width: var(--vf-share, 0%);
  height: 100%;
  background: var(--vf-accent);
  content: "";
}

.vf-ranking-empty {
  padding: 24px 0;
  color: var(--vf-muted);
  font-family: var(--vf-font-sans);
  font-size: 12px;
  line-height: 1.65;
}

.vf-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
}

.vf-data-note,
.vf-attribution {
  margin: 0 !important;
  color: var(--vf-faint) !important;
  font-family: var(--vf-font-sans) !important;
  font-size: 10.5px !important;
  font-weight: 400 !important;
  line-height: 1.6 !important;
}

.vf-attribution {
  text-align: right;
}

.vf-attribution a {
  color: var(--vf-muted);
  text-decoration-color: rgba(63, 107, 87, 0.3);
  text-underline-offset: 2px;
}

.vf-attribution a:hover {
  color: var(--vf-accent);
}

.visitor-footprints.is-loading .vf-metric dd {
  color: transparent;
}

.visitor-footprints.is-loading .vf-metric dd::after {
  display: block;
  width: 56px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(63, 107, 87, 0.06), rgba(63, 107, 87, 0.13), rgba(63, 107, 87, 0.06));
  background-size: 200% 100%;
  content: "";
  animation: vf-loading 1.4s linear infinite;
}

[data-scheme="dark"] .visitor-footprints {
  --vf-ink: #e7ede9;
  --vf-muted: #aab3ad;
  --vf-faint: #87918b;
  --vf-accent: #8fb8a2;
  --vf-accent-deep: #b1d1be;
  --vf-accent-soft: rgba(143, 184, 162, 0.13);
  --vf-accent-pale: rgba(143, 184, 162, 0.065);
  --vf-line: rgba(232, 237, 233, 0.12);
  --vf-line-strong: rgba(232, 237, 233, 0.2);
  --vf-paper: rgba(17, 21, 18, 0.72);
  --vf-panel: rgba(255, 255, 255, 0.035);
}

[data-scheme="dark"] .vf-period[aria-selected="true"] {
  background: var(--vf-accent);
  color: #111512;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

[data-scheme="dark"] .vf-map-base {
  opacity: 0.34;
  filter: grayscale(1) invert(0.8) sepia(0.16) hue-rotate(92deg) saturate(0.72) brightness(1.04);
}

[data-scheme="dark"] .vf-map-dot__core {
  stroke: rgba(17, 21, 18, 0.88);
}

[data-scheme="dark"] .vf-map-empty {
  background: rgba(17, 21, 18, 0.58);
}

[data-scheme="dark"] .vf-tooltip {
  border-color: rgba(143, 184, 162, 0.25);
  background: rgba(23, 28, 25, 0.96);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}

@keyframes vf-loading {
  to {
    background-position: -200% 0;
  }
}

@media (max-width: 880px) {
  .vf-head {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 18px;
  }

  .vf-periods {
    justify-self: start;
  }

  .vf-content {
    grid-template-columns: 1fr;
  }

  .vf-ranking-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
  }
}

@media (max-width: 640px) {
  .visitor-footprints {
    margin-top: 46px;
    margin-right: -18px;
    margin-left: -18px;
    padding: 30px 18px 28px;
  }

  .vf-head {
    margin-bottom: 24px;
  }

  .vf-title {
    font-size: 29px !important;
    letter-spacing: -0.03em;
  }

  .vf-subtitle {
    font-size: 13.5px !important;
  }

  .vf-period {
    min-width: 52px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .vf-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vf-metric {
    padding: 15px 14px;
  }

  .vf-metric:first-child {
    padding-left: 0;
  }

  .vf-metric:nth-child(3) {
    padding-left: 0;
    border-top: 1px solid var(--vf-line);
    border-left: 0;
  }

  .vf-metric:nth-child(4) {
    border-top: 1px solid var(--vf-line);
  }

  .vf-metric dd {
    font-size: 24px;
  }

  .vf-map-plot {
    min-height: 0;
    aspect-ratio: 1.75 / 1;
  }

  .vf-panel-note {
    display: none;
  }

  .vf-ranking-list {
    grid-template-columns: 1fr;
  }

  .vf-rank:nth-child(n + 6) {
    display: none;
  }

  .vf-foot {
    display: grid;
    gap: 10px;
  }

  .vf-attribution {
    text-align: left;
  }
}

@media (max-width: 380px) {
  .visitor-footprints {
    margin-right: -14px;
    margin-left: -14px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .vf-map-plot {
    min-height: 0;
    aspect-ratio: 1.65 / 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .visitor-footprints *,
  .visitor-footprints *::before,
  .visitor-footprints *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
