@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;600&display=swap');

:root {
  --primary-orange: #d35400;
  --dark-gray: #333;
  --light-gray: #f4f4f4;
  --input-border: #d35400;
  --button-bg: #d35400;
  --button-text: #ffffff;
  --pill-success: #00c896;
  --pill-danger: #ff3860;
  --primary-blue: #0059FF;
  --card-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  font-size: 18px;
  color: #333;
  font-weight: 400;
  transition: color 0.2s;
  min-width: 75px;
}

.nav-link .nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav-link:hover {
  color: var(--primary-blue);
  /* or your brand color */
}



.hero-header {
  background: rgba(255, 255, 255, 0.3);
  box-shadow: none;
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 1200;
  backdrop-filter: blur(16px) saturate(140%);
  transition: box-shadow 0.22s ease;
}

.hero-header.is-scrolled {
  box-shadow: var(--card-shadow);
}

.nav-link.active {
  color: var(--primary-blue);
  font-weight: 400;
}

.page-hero {
  padding: 20px;
  text-align: center;
}

.page-hero h1 {
  font-size: 42px;
  font-weight: 600;
  margin: 0 0 8px;
}

.page-hero p {
  margin: 0 auto;
  max-width: 720px;
  font-size: 15px;
  color: #64748b;
  line-height: 1.6;
}

.nav-dropdown {
  position: relative;
  display: inline-block;
}

/* 透明桥接区：填补 toggle 与下拉菜单之间的空隙，避免鼠标移入时菜单消失 */
.nav-dropdown::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 14px;
  z-index: 199;
}

.nav-dropdown-toggle {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}

.nav-dropdown-toggle::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  margin-top: 2px;
  transition: transform 0.2s;
}

.nav-dropdown:hover .nav-dropdown-toggle::after,
.nav-dropdown.open .nav-dropdown-toggle::after {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: auto;
  min-width: 170px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  z-index: 200;
  padding: 6px 0;
}

.nav-dropdown.open .nav-dropdown-menu {
  display: block;
}

@media (hover: hover) and (pointer: fine) {
  .nav-dropdown:hover .nav-dropdown-menu {
    display: block;
  }
}

.nav-dropdown-item {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  color: #333;
  font-size: 16px;
  font-weight: 400;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.nav-dropdown-item:hover,
.nav-dropdown-item.active {
  color: var(--primary-blue);
  background: #f0f7ff;
}

.nav-dropdown.active > .nav-dropdown-toggle {
  color: var(--primary-blue);
  font-weight: 400;
}

.header-wrapper {
  display: flex;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-toggle {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  margin-left: auto;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
}

.nav-toggle span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: #333;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease;
}

.nav-toggle span:nth-child(1) { top: 13px; }
.nav-toggle span:nth-child(2) { top: 19px; }
.nav-toggle span:nth-child(3) { top: 25px; }

.hero-header.is-nav-open .nav-toggle span:nth-child(1) {
  top: 19px;
  transform: rotate(45deg);
}

.hero-header.is-nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.hero-header.is-nav-open .nav-toggle span:nth-child(3) {
  top: 19px;
  transform: rotate(-45deg);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.site-logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.detection-stats {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  line-height: 1.35;
  color: #64748b;
  white-space: nowrap;
}

.detection-stats strong {
  color: #3794f8;
  font-weight: 600;
}

.detection-stats-today {
  font-size: 11px;
  color: #94a3b8;
}

.header-nav {
  display: flex;
  gap: 15px;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-nav-panel,
.nav-dropdown-panel {
  display: contents;
}

.search-bar {
  display: flex;
  align-items: center;
  max-width: 600px;
  margin: 2rem auto;
  background: #fff;
  border-radius: 40px;
  box-shadow: var(--card-shadow);
  padding: 0.25rem;
  /*border: 1px solid #c9d3ff;*/
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  color: #333;
  padding: 1rem 1.5rem;
  font-size: 16pt;
  border-radius: 40px 0 0 40px;
  min-width: 0;
}

.search-bar .primary-button {
  width: 88px;
  height: 55px;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  border-radius: 40px;
}

.search-bar .primary-button .icon {
  width: 18px;
  height: 18px;
  display: block;
}

/* 馃攣 General-purpose reusable button */
.primary-button {
  padding: 1rem 2rem;
  font-size: 14pt;
  background-color: var(--primary-blue);
  color: #fff;
  border: none;
  border-radius: 40px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.primary-button:hover {
  background-color: rgba(0, 47, 255, 0.82);
}

.button-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  /* space between spinner and text */
}



.search-bar button:hover {
  background-color: rgba(32, 73, 255, 0.882);
}

.search-bar input:-webkit-autofill {
  background-color: #fff !important;
  -webkit-box-shadow: 0 0 0px 1000px #fff inset !important;
  -webkit-text-fill-color: #000 !important;
  transition: background-color 5000s ease-in-out 0s;
}

.search-bar input:-webkit-autofill:focus {
  background-color: #fff !important;
}



*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  margin: 0;
  padding: 0;
  background: #f8f9fa;
  color: #333;
  overflow-x: hidden;
}

img,
video {
  max-width: 100%;
  height: auto;
}

svg {
  max-width: 100%;
}

.site-logo {
  height: 32px;
  width: auto;
  max-width: none;
}

.result-box {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  padding: 0rem;
}

/* Make result table bigger and rounded */
.result-table {
  background: linear-gradient(180deg, #eef4ff 0%, #e8f0fe 100%);
  width: 100%;
  max-width: 1000px;
  min-width: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

/* Rounded corners on outer table */
.result-box table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  /*border: 1px solid #c9d3ff;*/
  border-radius: 0px;
  overflow: hidden;
  font-size: 1.1rem;
}


.result-box th {
  background-color: #f9f9f9;
  text-align: center;
  padding: 1rem;
  font-size: 1.1rem;
}

.result-box td {
  padding: 1rem;
  align-items: center;
  font-size: 1.05rem;
}

.ip-result-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
  background: white;
  /* border: 1px solid #ddd; */
  border-radius: 18px;
  overflow: hidden;
  font-size: 14px;
}

/* Header */
.ip-result-table th {
  background-color: #f9f9f9;
  /* padding: 1rem; */
  text-align: center;
  font-size: 14px;
}


/* General cells — 统一 px，避免 rem + 手机自动放大导致各行大小不一 */
.ip-result-table td {
  font-size: 14px;
  padding: 1rem;
  line-height: 1.5;
}

.ip-result-table td a {
  font-size: inherit;
  color: var(--primary-blue);
}

.ip-result-table td:first-child {
  width: 25%;
  text-align: right;
  font-weight: 500;
  color: #333;
  
}

.ip-result-table td:last-child {
  width: 75%;
  text-align: left;
  align-items: center;
  color: #333;
}

.ip-result-table .country-loc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.5;
}

.ip-result-table .country-flag {
  height: 1em;
  width: auto;
  flex-shrink: 0;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06);
}

/* Alternating row colors */
.ip-result-table tbody tr:nth-child(odd) {
  background-color: #ffffff;
}

.ip-result-table tbody tr:nth-child(even) {
  background-color: #f6f8ff;
  /* light blue (AliceBlue) */
}


.tooltip-container {
  position: relative;
  display: inline-block;
}

.info-icon {
  cursor: pointer;
  color: #2a74ff;
  font-size: 16px;
}



.tooltip-text {
  visibility: hidden;
  opacity: 0;
  background-color: #2978ffcf;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  position: absolute;
  bottom: 80%;
  left: 120%;
  transform: translateX(-50%);
  z-index: 10;
  font-size: 16px;
  width: 240px;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  transition: opacity 0.2s;
}

/* Show tooltip on hover/focus or tap */
.tooltip-container:hover .tooltip-text,
.tooltip-container:focus-within .tooltip-text,
.tooltip-container.active .tooltip-text {
  visibility: visible;
  opacity: 1;
}



footer {
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  margin: 3rem 0 1rem;
}

.spinner {
  border: 2px solid #ffffff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  width: 1em;
  height: 1em;
  margin-right: 0.5em;
  animation: spin 0.6s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}


@media (max-width: 768px) {
  .page-hero {
    padding: 16px 8px;
  }

  .page-hero h1 {
    font-size: 28px;
  }

  .page-hero p {
    font-size: 14px;
  }

  .header-wrapper {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 8px;
    row-gap: 0;
  }

  .nav-toggle {
    display: inline-block;
    order: 2;
  }

  .header-brand,
  .header-wrapper > .site-logo-link {
    order: 1;
  }

  .header-nav {
    display: grid;
    grid-template-rows: 0fr;
    order: 3;
    margin-left: 0;
    width: 100%;
    justify-content: stretch;
    align-content: start;
    padding-top: 0;
    overflow: hidden;
    transition: grid-template-rows 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .hero-header.is-nav-open .header-nav {
    grid-template-rows: 1fr;
  }

  .header-nav-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  .header-nav-panel::before {
    content: '';
    display: block;
    height: 6px;
    flex-shrink: 0;
  }

  .header-nav-panel > * {
    flex-shrink: 0;
  }

  .nav-link {
    display: flex;
    min-width: 0;
    width: 100%;
    justify-content: flex-start;
    font-size: 16px;
    padding: 12px 4px;
    border-bottom: 1px solid #eef2f7;
    box-sizing: border-box;
    flex-shrink: 0;
  }

  .nav-dropdown {
    display: block;
    width: 100%;
  }

  .nav-dropdown-toggle {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-dropdown-toggle::after {
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .nav-dropdown::after {
    display: none;
  }

  .nav-dropdown-menu {
    position: static;
    display: grid;
    grid-template-rows: 0fr;
    min-width: 0;
    width: 100%;
    right: auto;
    left: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: #f8fafc;
    padding: 0;
    overflow: hidden;
    transition: grid-template-rows 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .nav-dropdown:hover .nav-dropdown-menu {
    display: grid;
    grid-template-rows: 0fr;
  }

  .nav-dropdown.open .nav-dropdown-menu,
  .nav-dropdown.open:hover .nav-dropdown-menu {
    display: grid;
    grid-template-rows: 1fr;
  }

  .nav-dropdown-panel {
    display: block;
    min-height: 0;
    overflow: hidden;
  }

  .nav-dropdown-item {
    width: 100%;
    padding: 12px 16px 12px 36px;
    border-bottom: 1px solid #eef2f7;
    white-space: normal;
    box-sizing: border-box;
  }

  @media (prefers-reduced-motion: reduce) {
    .header-nav,
    .nav-dropdown-menu,
    .nav-dropdown-toggle::after {
      transition: none;
    }
  }

  .search-bar {
    border-radius: 100px;
    padding: 0.35rem;
    margin: 1.25rem auto;
  }

  .search-bar input {
    border-radius: 100px;
    font-size: 16px;
    padding: 0.75rem 1rem;
  }

  .search-bar .primary-button {
    width: 64px;
    height: 48px;
  }

  .result-box {
    padding: 0;
    margin-top: 0.75rem;
  }

  .result-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ip-result-table td {
    padding: 0.7rem 0.65rem;
    word-break: break-word;
  }

  .ip-result-table td:first-child {
    width: 32%;
  }

  .ip-result-table td:last-child {
    width: 68%;
  }

  .result-box th,
  .result-box td,
  .ip-result-table th,
  .ip-result-table td,
  .ip-result-table td a {
    font-size: 13px;
  }

  .tooltip-text {
    visibility: hidden;
    opacity: 0;
    background-color: #2978ffcf;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    position: absolute;
    bottom: 0%;
    left: 0%;
    transform: translateY(-50%);
    z-index: 10;
    font-size: 14px;
    width: min(240px, 70vw);
    text-align: center;
    white-space: normal;
    word-break: break-word;
    transition: opacity 0.2s;
  }
}
