/* Base Styles & Theme Variables (go-khlink visual style + vf66 structure) */
:root {
  --primary-bg: rgb(16, 50, 71);
  --bg-top: rgb(23, 68, 96);
  --bg-bottom: rgb(10, 33, 48);
  --card-bg: rgba(11, 37, 54, 0.76);
  --card-hover-bg: rgba(20, 61, 87, 0.92);
  --card-border: rgba(255, 255, 255, 0.1);
  --card-hover-border: rgba(93, 226, 150, 0.48);
  --text-main: #f3f9fc;
  --text-muted: #9ab7c9;
  --text-subtle: #7898ad;
  --dial-track: rgba(255, 255, 255, 0.1);
  --status-fast: #5de296;
  --status-fast-text: #a3e635;
  --status-stable: #facc15;
  --status-normal: #f59e0b;
  --status-timeout: #ef4444;
  --gold-accent: #f5c43d;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at 50% 0%, var(--bg-top) 0%, var(--primary-bg) 48%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 18px;
}

/* Starry Particles Background */
#particles-js {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Fixed Top-Right Language Switcher */
.lang-switcher-fixed {
  position: fixed;
  top: 16px;
  right: 18px;
  z-index: 200;
}

.lang-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-select {
  background: rgba(16, 50, 71, 0.88);
  color: #edf7fc;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  backdrop-filter: blur(8px);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.lang-select:hover,
.lang-select:focus {
  border-color: rgba(93, 226, 150, 0.6);
  background: rgba(22, 66, 94, 0.96);
}

.lang-select option {
  background: rgb(16, 50, 71);
  color: #f3f9fc;
}

.lang-select-arrow {
  position: absolute;
  right: 11px;
  font-size: 10px;
  color: #c6ddd6;
  pointer-events: none;
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 44px 0 24px;
}

.brand-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.brand-logo-img {
  width: 280px;
  max-width: 72vw;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 20px rgba(245, 196, 61, 0.22));
}

.hero-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

/* Entry Grid Section */
.entry-section {
  padding: 8px 0 36px;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.entry-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 20px;
  backdrop-filter: blur(8px);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.entry-card:hover {
  transform: translateY(-3px);
  background: var(--card-hover-bg);
  border-color: var(--card-hover-border);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), 0 0 18px rgba(93, 226, 150, 0.08);
}

.entry-card:active {
  transform: translateY(-1px);
}

/* Circular Latency Dial */
.dial-wrap {
  position: relative;
  width: 108px;
  height: 108px;
  flex-shrink: 0;
}

.dial-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

.dial-track {
  fill: none;
  stroke: var(--dial-track);
  stroke-width: 10;
}

.dial-arc {
  fill: none;
  stroke: var(--status-fast);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.7s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.4s ease;
  filter: drop-shadow(0 0 6px rgba(93, 226, 150, 0.55));
}

.dial-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.dial-value-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  line-height: 1.1;
}

.dial-ms {
  font-size: 24px;
  font-weight: 800;
  color: var(--status-fast-text);
  font-variant-numeric: tabular-nums;
  transition: color 0.4s ease;
}

.dial-unit {
  font-size: 12px;
  font-weight: 600;
  color: var(--status-fast-text);
  opacity: 0.9;
  transition: color 0.4s ease;
}

.dial-status {
  font-size: 12px;
  color: #cbdcd6;
  margin-top: 3px;
}

/* Dial State Variants */
.entry-card.is-stable .dial-arc {
  stroke: var(--status-stable);
  filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.5));
}
.entry-card.is-stable .dial-ms,
.entry-card.is-stable .dial-unit {
  color: var(--status-stable);
}

.entry-card.is-normal .dial-arc {
  stroke: var(--status-normal);
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.5));
}
.entry-card.is-normal .dial-ms,
.entry-card.is-normal .dial-unit {
  color: var(--status-normal);
}

.entry-card.is-timeout .dial-arc {
  stroke: var(--status-timeout);
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.5));
}
.entry-card.is-timeout .dial-ms,
.entry-card.is-timeout .dial-unit {
  color: var(--status-timeout);
}

/* Entry Right Text Info */
.entry-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.entry-name {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.entry-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: #b7cfc7;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--status-fast);
  box-shadow: 0 0 8px rgba(93, 226, 150, 0.85);
  animation: live-pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes live-pulse {
  0% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(93, 226, 150, 0.65);
  }
  70% {
    transform: scale(1.02);
    box-shadow: 0 0 0 6px rgba(93, 226, 150, 0);
  }
  100% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(93, 226, 150, 0);
  }
}

.entry-cta {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.25s ease;
}

.entry-card:hover .entry-cta {
  color: var(--status-fast);
}

/* Latency Color Legend */
.legend-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 22px;
  margin-top: 22px;
  font-size: 13px;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-fast { background: var(--status-fast); }
.dot-stable { background: var(--status-stable); }
.dot-normal { background: var(--status-normal); }
.dot-timeout { background: var(--status-timeout); }

/* Why Choose Section */
.features-section {
  padding: 28px 0 44px;
}

.section-title {
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 24px;
  letter-spacing: 0.5px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px 22px;
  backdrop-filter: blur(8px);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 196, 61, 0.35);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(245, 196, 61, 0.12);
  border: 1px solid rgba(245, 196, 61, 0.28);
  color: var(--gold-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.feature-title {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Footer */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 36px 0 42px;
  text-align: center;
  background: rgba(9, 29, 43, 0.6);
}

.footer-logo-img {
  width: 156px;
  height: auto;
  margin-bottom: 18px;
  opacity: 0.95;
}

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 24px;
  margin-bottom: 20px;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: #cfe3dc;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: 999px;
}

.trust-badge i {
  color: var(--gold-accent);
  font-size: 13px;
}

.footer-copy {
  font-size: 12px;
  color: var(--text-subtle);
}

/* Scroll To Top Button */
.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(16, 50, 71, 0.9);
  color: #edf7fc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, border-color 0.25s ease;
  z-index: 150;
  backdrop-filter: blur(8px);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  border-color: rgba(93, 226, 150, 0.6);
  color: var(--status-fast);
}

/* Responsive Breakpoints */
@media (max-width: 680px) {
  .container {
    padding: 0 12px;
  }

  .lang-switcher-fixed {
    top: 12px;
    right: 12px;
  }

  .lang-select {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 8px;
  }

  .hero-section {
    padding: 46px 0 14px;
  }

  .brand-logo-wrap {
    margin-bottom: 10px;
  }

  .brand-logo-img {
    width: 190px;
  }

  .hero-title {
    font-size: 22px;
    margin-bottom: 4px;
  }

  .hero-subtitle {
    font-size: 12px;
    line-height: 1.5;
  }

  .entry-section {
    padding: 6px 0 22px;
  }

  /* Mobile: 2-column vertical cards so all 6 entries fit cleanly above the fold */
  .entry-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .entry-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 14px 10px 12px;
    gap: 10px;
    border-radius: 14px;
  }

  .dial-wrap {
    width: 82px;
    height: 82px;
  }

  .dial-ms {
    font-size: 18px;
  }

  .dial-unit,
  .dial-status {
    font-size: 10px;
  }

  .entry-info {
    align-items: center;
    gap: 4px;
    width: 100%;
  }

  .entry-name {
    font-size: 14px;
    line-height: 1.25;
  }

  .entry-live {
    justify-content: center;
    gap: 5px;
    font-size: 11px;
  }

  .live-dot {
    width: 7px;
    height: 7px;
  }

  .entry-cta {
    font-size: 11px;
    line-height: 1.3;
  }

  .legend-bar {
    gap: 6px 14px;
    margin-top: 14px;
    font-size: 11px;
  }

  .legend-dot {
    width: 8px;
    height: 8px;
  }

  /* Mobile: 2x2 compact features grid */
  .features-section {
    padding: 18px 0 28px;
  }

  .section-title {
    font-size: 19px;
    margin-bottom: 14px;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .feature-card {
    padding: 14px 12px;
    border-radius: 12px;
  }

  .feature-icon {
    width: 34px;
    height: 34px;
    font-size: 15px;
    border-radius: 9px;
    margin-bottom: 10px;
  }

  .feature-title {
    font-size: 14px;
    margin-bottom: 5px;
    line-height: 1.3;
  }

  .feature-desc {
    font-size: 11px;
    line-height: 1.5;
  }

  .site-footer {
    padding: 24px 0 30px;
  }

  .footer-logo-img {
    width: 128px;
    margin-bottom: 12px;
  }

  .trust-badges {
    gap: 8px 10px;
    margin-bottom: 14px;
  }

  .trust-badge {
    font-size: 11px;
    padding: 5px 10px;
  }

  .footer-copy {
    font-size: 11px;
  }

  .back-to-top {
    right: 12px;
    bottom: 16px;
    width: 36px;
    height: 36px;
  }
}
