:root {
  --bg: radial-gradient(circle at 10% 20%, #e2e6e3, #cdd2cf);
  --glass: rgba(255, 255, 255, 0.4);
  --glass-border: rgba(255, 255, 255, 0.5);
  --ink: #0a0a0a;
  --shadow-glass: 0 12px 32px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.3) inset;
  --radius: 20px;
  --radius-sm: 12px;
  --card-radius: 24px;
  --transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

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

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  line-height: 1.5;
  backdrop-filter: blur(2px);
}

body.menu-open {
  overflow: hidden;
}

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

img {
  display: block;
  max-width: 100%;
}

.site-header {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
  z-index: 1001;
}

.header-inner {
  width: min(100% - 32px, 1040px);
  min-height: 70px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 800;
  font-size: clamp(0.95rem, 2.6vw, 1.2rem);
}

.brand-mark {
  width: 32px;
  height: 32px;
  border: 2px solid #fff;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.15);
}

.brand-mark img {
  width: 18px;
  height: 18px;
}

.menu-toggle {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}

.menu-toggle span,
.menu-toggle::before,
.menu-toggle::after {
  content: "";
  width: 22px;
  height: 2px;
  background: currentColor;
  display: block;
  transition: transform 200ms cubic-bezier(0.2, 0.9, 0.4, 1.1), opacity 180ms ease;
}

.menu-toggle span {
  margin: 5px 0;
}

.menu-toggle[aria-expanded="true"]::before {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"]::after {
  transform: translateY(-7px) rotate(-45deg);
}

.main-nav {
  position: absolute;
  top: calc(100% + 8px);
  right: max(16px, calc((100% - min(100% - 32px, 1040px)) / 2));
  width: 220px;
  z-index: 1100;
  display: none;
  background: rgba(10, 10, 10, 0.97);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.06) inset;
  overflow: hidden;
  animation: dropDown 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.main-nav.is-open {
  display: block;
}

@keyframes dropDown {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.nav-grid {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
  gap: 0;
}

.nav-grid a {
  color: rgba(255, 255, 255, 0.72);
  padding: 11px 20px;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  transition: background 0.15s, color 0.15s;
  border-radius: 0;
}

.nav-grid a:last-child {
  border-bottom: none;
}

.nav-grid a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.main {
  width: min(100% - 32px, 1040px);
  margin: 0 auto;
  padding: 40px 0 70px;
  position: relative;
  z-index: 1;
}

.section {
  margin-bottom: 48px;
}

.panel,
.ip-widget,
.faq-container,
.resource-panel {
  background: rgba(255, 255, 255, 0.38) !important;
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-glass);
}

.ip-widget {
  height: auto;
  min-height: 580px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.ip-widget .content-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: stretch;
}

#info-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#map {
  height: 100%;
  min-height: 520px;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(240, 242, 240, 0.6);
  backdrop-filter: blur(4px);
}

.info-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 1rem;
  transition: var(--transition);
}

.info-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: #1a1a1a;
  font-size: 1rem;
}

.info-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.info-value {
  text-align: right;
  color: #1e2a1e;
  font-weight: 500;
  word-break: break-word;
  font-size: 1rem;
}

#search-bar {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
}

#search-ip {
  border: 0;
  padding: 12px 16px;
  font-size: 0.95rem;
  background: transparent;
  outline: none;
  color: #000;
}

#search-ip::placeholder {
  color: #3a3a3a;
}

#search-btn {
  border: 0;
  background: #000;
  color: #fff;
  padding: 0 24px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

#search-btn:hover {
  background: #2c2c2c;
}

#loader {
  display: none;
  width: 30px;
  height: 30px;
  margin: 16px auto;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.section-title {
  margin: 0 0 24px;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #111;
  text-align: center;
}

.centered-title {
  justify-content: center;
}

.ip-title {
  justify-content: flex-start;
  margin-bottom: 18px;
}

.title-icon {
  width: 28px;
  height: 28px;
}

.faq-container {
  padding: 24px 28px;
}

.faq-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.faq-item:last-child {
  border-bottom: 0;
}

.faq-question {
  width: 100%;
  background: transparent;
  border: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 8px 0;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  color: #0f0f0f;
  text-align: left;
}

.faq-question:hover {
  color: #000;
}

.faq-question::after {
  content: "+";
  font-size: 1.6rem;
  font-weight: 400;
}

.faq-question[aria-expanded="true"]::after {
  content: "−";
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  color: #2d2d2d;
  line-height: 1.65;
  transition: max-height 0.3s ease, padding-bottom 0.3s ease;
}

.faq-answer.open {
  max-height: 800px;
  padding-bottom: 24px;
}

.resource-panel {
  padding: clamp(16px, 4vw, 48px);
  overflow: hidden;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.resource-card {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--card-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 8px;
  aspect-ratio: 1;
  justify-content: center;
  transition: var(--transition);
  box-shadow: var(--shadow-glass);
  min-width: 0;
  overflow: hidden;
}

.resource-card:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(0, 0, 0, 0.15);
}

.resource-card img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin-bottom: 12px;
  filter: grayscale(0.15);
}

.resource-card span {
  font-weight: 700;
  font-size: 0.95rem;
  color: #111;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.tools-grid-15,
.tools-grid-9 {
  grid-template-columns: repeat(3, 1fr);
}

.tool-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  font-weight: 700;
  color: #111;
  transition: var(--transition);
  min-height: 52px;
  font-size: 0.9rem;
}

.tool-link:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.tool-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.site-footer {
  background: #000000;
  color: #c0c0c0;
  border-top: 1px solid #222;
  padding: 32px 20px 44px;
  text-align: center;
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 18px;
}

.footer-links a {
  color: #c0c0c0;
  font-weight: 600;
  transition: opacity 0.2s;
}

.footer-links a:hover {
  opacity: 0.7;
}

@media (max-width: 900px) {
  .tools-grid,
  .tools-grid-15,
  .tools-grid-9 {
    grid-template-columns: repeat(2, 1fr);
  }
  .ip-widget .content-wrapper {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .ip-widget {
    height: auto;
  }
  #map {
    min-height: 300px;
  }
  .resource-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .nav-grid {
    width: 200px;
  }
}

@media (max-width: 620px) {
  .tools-grid,
  .tools-grid-15,
  .tools-grid-9 {
    grid-template-columns: 1fr;
  }
  .header-inner,
  .main {
    width: min(100% - 24px, 1040px);
  }
  .site-header {
    min-height: 56px;
  }
  .header-inner {
    min-height: 56px;
  }
  .brand {
    font-size: 0.75rem;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .brand-mark {
    flex-shrink: 0;
  }
  .brand-mark {
    width: 26px;
    height: 26px;
  }
  .menu-toggle {
    width: 38px;
    height: 38px;
  }
  .main {
    padding-top: 24px;
  }
  .ip-widget {
    padding: 16px;
  }
  .info-row {
    grid-template-columns: minmax(100px, 0.8fr) 1fr;
    gap: 12px;
    padding: 6px 0;
    font-size: 0.85rem;
  }
  .info-label {
    gap: 6px;
    font-size: 0.85rem;
  }
  .info-icon {
    width: 18px;
    height: 18px;
  }
  .info-value {
    font-size: 0.85rem;
  }
  .title-icon {
    width: 24px;
    height: 24px;
  }
  .section-title {
    gap: 6px;
    margin-bottom: 16px;
  }
  .ip-title {
    margin-bottom: 12px;
  }
  #search-bar {
    margin-top: 16px;
  }
  #search-ip {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
  #search-btn {
    padding: 0 16px;
    font-size: 0.85rem;
  }
  #map {
    min-height: 240px;
  }
  .faq-container {
    padding: 16px 18px;
  }
  .faq-question {
    font-size: 0.95rem;
    padding: 8px 0;
  }
  .resource-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .resource-card {
    padding: 12px 6px;
  }
  .resource-card img {
    width: 44px;
    height: 44px;
  }
  .resource-card span {
    font-size: 0.8rem;
  }
  .tool-link {
    padding: 8px 14px;
    font-size: 0.85rem;
    min-height: 48px;
  }
  .tool-icon {
    width: 20px;
    height: 20px;
  }
  .section {
    margin-bottom: 32px;
  }
  .main-nav {
    top: calc(100% + 6px);
    right: 12px;
    width: 200px;
  }
}
