:root {
  color-scheme: dark;
  --bg: #0a2625;
  --bg-deep: #061514;
  --panel: rgba(3, 12, 14, 0.88);
  --panel-strong: rgba(6, 18, 20, 0.94);
  --scene-filter: saturate(0.86) brightness(0.82) contrast(1.03);
  --text: #f5f7fb;
  --muted: #aebcc3;
  --subtle: #d9e6ed;
  --pink: #ff5aa7;
  --blue: #76d7ff;
  --green: #7de2aa;
  --amber: #ffd166;
  --red: #ff7070;
  --line: rgba(255, 255, 255, 0.12);
}

* {
  box-sizing: border-box;
}

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

body {
  position: relative;
  z-index: 0;
  overflow-x: hidden;
  background: var(--bg-deep);
  color: var(--text);
  font-family:
    "Segoe UI", "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, sans-serif;
}

button {
  font: inherit;
}

.parallaxScene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  contain: paint;
  background: #b7ded9 url("/assets/summer-fields-fullscreen-v2.webp") center / cover no-repeat;
}

.parallaxCamera {
  position: absolute;
  inset: -2.5vmax;
  transform: translate3d(var(--camera-x, 0), var(--camera-y, 0), 0) scale(1.015);
  transform-origin: center;
  will-change: transform;
  backface-visibility: hidden;
}

.parallaxPlate {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 50% 50%;
  user-select: none;
}

.parallaxBase {
  filter: var(--scene-filter);
}

.depthLayer {
  transform: translate3d(var(--depth-x, 0), var(--depth-y, 0), 0) scale(1);
  transform-origin: center;
  will-change: transform;
  backface-visibility: hidden;
  filter: var(--scene-filter);
}

.depthSky {
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 41%, transparent 65%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 41%, transparent 65%);
  opacity: 0.28;
}

.depthHorizon {
  -webkit-mask-image: linear-gradient(to bottom, transparent 35%, #000 49%, #000 64%, transparent 78%);
  mask-image: linear-gradient(to bottom, transparent 35%, #000 49%, #000 64%, transparent 78%);
  opacity: 0.32;
}

.depthTraveler {
  -webkit-mask-image: radial-gradient(ellipse 19% 23% at 29% 54%, #000 26%, rgba(0, 0, 0, 0.86) 48%, transparent 76%);
  mask-image: radial-gradient(ellipse 19% 23% at 29% 54%, #000 26%, rgba(0, 0, 0, 0.86) 48%, transparent 76%);
  opacity: 0.52;
}

.depthTrain {
  -webkit-mask-image: radial-gradient(ellipse 26% 27% at 91% 55%, #000 23%, rgba(0, 0, 0, 0.82) 51%, transparent 78%);
  mask-image: radial-gradient(ellipse 26% 27% at 91% 55%, #000 23%, rgba(0, 0, 0, 0.82) 51%, transparent 78%);
  opacity: 0.5;
}

.depthForeground {
  -webkit-mask-image: linear-gradient(to bottom, transparent 57%, rgba(0, 0, 0, 0.76) 71%, #000 86%);
  mask-image: linear-gradient(to bottom, transparent 57%, rgba(0, 0, 0, 0.76) 71%, #000 86%);
  opacity: 0.38;
}

.sceneShade,
.sceneLoader {
  position: absolute;
  inset: 0;
}

.sceneShade {
  background:
    radial-gradient(ellipse 78% 66% at 50% 42%, rgba(4, 16, 17, 0.04), rgba(2, 10, 11, 0.2) 100%),
    linear-gradient(180deg, rgba(2, 10, 11, 0.07), rgba(2, 9, 10, 0.24));
}

.sceneLoader {
  background: var(--bg-deep);
  opacity: 1;
  transition: opacity 500ms ease;
}

.parallaxScene.isReady .sceneLoader {
  opacity: 0;
}

.page {
  position: relative;
  z-index: 10;
  width: min(1040px, calc(100vw - 28px));
  margin: clamp(14px, 2.2vh, 24px) auto 0;
  padding: 0 0 64px;
}

.page > section + section {
  margin-top: 18px;
}

.pricePanel,
.trafficPanel,
.vpnPanel {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, var(--panel-strong), var(--panel));
  border-radius: 8px;
  padding: 18px;
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  isolation: isolate;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.sectionHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.sectionHeader h1 {
  margin: 0;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.2;
  letter-spacing: 0;
}

#priceUpdated,
#vpnUpdated {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.priceGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.priceCard {
  border: 1px solid var(--line);
  background: rgba(3, 12, 14, 0.44);
  border-radius: 8px;
  padding: 14px;
  min-width: 0;
}

.priceCard h2 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.3;
}

.marketName {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.priceRows {
  display: grid;
  gap: 8px;
}

.priceRow {
  display: grid;
  grid-template-columns: minmax(72px, 0.8fr) minmax(88px, 1fr) minmax(80px, 1fr);
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
}

.priceSource {
  color: var(--subtle);
  font-weight: 700;
}

.sourceLink {
  color: inherit;
  text-decoration: none;
}

.sourceLink:hover {
  color: var(--blue);
}

.priceValue {
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  text-align: right;
}

.priceStatus {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
  overflow-wrap: anywhere;
}

.priceStatus.ok,
.statusOnline {
  color: var(--green);
}

.priceStatus.warn,
.statusRecent {
  color: var(--amber);
}

.priceStatus.error,
.statusOffline {
  color: var(--red);
}

.portraitStage {
  min-height: 46vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
}

.portrait {
  width: min(390px, 84vw);
  max-height: 48vh;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 36px rgba(118, 215, 255, 0.18));
  animation: imageFade 5s ease both;
  pointer-events: none;
}

.keywordLine {
  color: var(--text);
  font-size: clamp(26px, 6vw, 64px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0;
  text-align: center;
  text-shadow:
    0 0 22px rgba(255, 90, 167, 0.36),
    0 0 42px rgba(118, 215, 255, 0.22),
    0 0 54px rgba(255, 112, 112, 0.15);
  animation: keywordPulse 9s ease-in-out infinite;
  pointer-events: none;
}

.rangeTabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 9, 10, 0.72);
  padding: 4px;
}

.rangeTabs button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  min-height: 34px;
  padding: 0 12px;
  cursor: pointer;
}

.rangeTabs button.active {
  background: rgba(118, 215, 255, 0.16);
  color: var(--text);
}

.rangeTabs button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.trafficSummary,
.vpnSummary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
}

.trafficSummary strong,
.vpnSummary strong {
  color: var(--text);
}

.summaryPill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(4, 15, 17, 0.5);
  padding: 6px 10px;
  font-size: 14px;
}

.chartShell {
  border: 1px solid var(--line);
  background: rgba(2, 8, 9, 0.78);
  border-radius: 8px;
  min-height: 260px;
  overflow: hidden;
}

#trafficChart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 260px;
}

.chartGrid {
  stroke: rgba(255, 255, 255, 0.09);
  stroke-width: 1;
}

.chartAxis {
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 1;
}

.chartLabel,
.chartEmpty {
  fill: var(--muted);
  font-size: 14px;
}

.chartLegend {
  fill: var(--subtle);
  font-size: 14px;
  font-weight: 700;
}

.lineRx,
.lineTx {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lineRx {
  stroke: var(--blue);
}

.lineTx {
  stroke: var(--pink);
}

.pointRx,
.pointTx {
  stroke: #061011;
  stroke-width: 2;
}

.pointRx {
  fill: var(--blue);
}

.pointTx {
  fill: var(--pink);
}

.vpnDeviceList {
  display: grid;
  gap: 10px;
}

.vpnDeviceItem {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(90px, 0.7fr) minmax(100px, 0.8fr) minmax(140px, 1fr) minmax(140px, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(3, 12, 14, 0.48);
  border-radius: 8px;
  padding: 14px;
}

.vpnDeviceName {
  min-width: 0;
}

.vpnDeviceName strong,
.vpnDeviceItem strong {
  display: block;
  overflow-wrap: anywhere;
}

.vpnDeviceName span,
.vpnDeviceItem span,
.vpnDeviceList p {
  color: var(--muted);
  font-size: 13px;
}

.statusDot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
}

.statusDot::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 18px currentColor;
}

.emptyState {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(3, 12, 14, 0.42);
  padding: 18px;
}

.mouse-network-canvas {
  position: fixed;
  inset: 0;
  z-index: 2;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

.privateSubEntry {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 30;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(118, 215, 255, 0.55);
  background: rgba(118, 215, 255, 0.46);
  box-shadow:
    0 0 0 4px rgba(118, 215, 255, 0.08),
    0 0 18px rgba(118, 215, 255, 0.24);
  opacity: 0.62;
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.privateSubEntry:hover,
.privateSubEntry:focus-visible {
  background: rgba(118, 215, 255, 0.9);
  opacity: 1;
  outline: 0;
  transform: scale(1.18);
}

.archiveEntry {
  position: fixed;
  right: 56px;
  bottom: 31px;
  z-index: 30;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 90, 167, 0.42);
  background: rgba(255, 90, 167, 0.34);
  box-shadow: 0 0 14px rgba(255, 90, 167, 0.18);
  opacity: 0.42;
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.archiveEntry:hover,
.archiveEntry:focus-visible {
  background: rgba(255, 90, 167, 0.82);
  opacity: 1;
  outline: 0;
  transform: scale(1.25);
}

@keyframes imageFade {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes keywordPulse {
  0%,
  100% {
    opacity: 0.16;
    filter: blur(5px);
    transform: translateY(10px);
  }

  45%,
  60% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .parallaxCamera {
    inset: -4vmax;
  }

  .parallaxPlate {
    object-position: 29% 50%;
  }

  .depthTraveler {
    -webkit-mask-image: radial-gradient(ellipse 29% 22% at 25% 54%, #000 22%, rgba(0, 0, 0, 0.82) 50%, transparent 78%);
    mask-image: radial-gradient(ellipse 29% 22% at 25% 54%, #000 22%, rgba(0, 0, 0, 0.82) 50%, transparent 78%);
  }

  .page {
    width: min(100vw - 18px, 1040px);
  }

  .page {
    margin-top: 12px;
  }

  .pricePanel,
  .trafficPanel,
  .vpnPanel {
    padding: 14px;
  }

  .sectionHeader {
    align-items: flex-start;
    flex-direction: column;
  }

  #priceUpdated,
  #vpnUpdated {
    white-space: normal;
  }

  .priceGrid {
    grid-template-columns: 1fr;
  }

  .priceRow {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .priceValue,
  .priceStatus {
    text-align: left;
  }

  .portraitStage {
    min-height: 42vh;
  }

  .rangeTabs {
    width: 100%;
  }

  .rangeTabs button {
    flex: 1;
    padding: 0 6px;
  }

  .vpnDeviceItem {
    grid-template-columns: 1fr;
  }
}
