:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #f3f5f8;
  --text: #24292f;
  --muted: #737b84;
  --line: #d8dde3;
  --nav: #20252b;
  --blue: #1e6ff2;
  --green: #47c774;
  --gray: #78818a;
  --dark: #22272d;
  --cyan: #28b9da;
  --footer: #cdced0;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(25, 35, 45, 0.08);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Plus Jakarta Sans", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(30, 111, 242, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(71, 199, 116, 0.06), transparent 24%),
    linear-gradient(180deg, #fbfbfc 0%, #f3f5f7 100%);
  color: var(--text);
  font-size: 15px;
}

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

.container {
  width: min(100% - 40px, 1320px);
  margin: 0 auto;
}

.topbar {
  background: var(--nav);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 84px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.brand img {
  display: block;
  height: 42px;
  width: auto;
  max-width: 220px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.9rem;
  font-weight: 600;
}

.nav a:hover {
  color: #fff;
  text-shadow: 0 0 18px rgba(71, 199, 116, 0.18);
}

.menu-toggle {
  display: none;
  margin-left: auto;
  border: 0;
  background: transparent;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px 0;
  background: #fff;
}

.page {
  padding: 22px 0 40px;
}

.breadcrumb-icon {
  display: inline-flex;
  color: var(--blue);
  margin-bottom: 16px;
  filter: drop-shadow(0 0 10px rgba(71, 199, 116, 0.16));
}

.breadcrumb-icon svg {
  width: 24px;
  height: 24px;
}

.hero-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(242, 245, 248, 0.94));
  border: 1px solid rgba(216, 221, 227, 0.6);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px 18px;
}

.ip-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.ip-row h1 {
  margin: 0;
  color: var(--blue);
  font-size: clamp(1.55rem, 2.8vw, 2.3rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.copy-btn {
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), #2f7ff5 70%, rgba(71, 199, 116, 0.92));
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease;
}

.copy-btn:hover {
  transform: translateY(-1px);
}

.hero-copy p {
  margin: 0;
  font-size: clamp(0.95rem, 1.1vw, 1.02rem);
  line-height: 1.5;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 8px;
}

.tool-grid-single {
  width: 100%;
}

.tool-grid-single .tool-btn {
  width: 100%;
}

.tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
}

.tool-btn.primary {
  background: linear-gradient(90deg, var(--blue), #2b79f4);
}

.tool-btn.muted {
  background: var(--gray);
}

.tool-btn.dark {
  background: var(--dark);
}

.tool-btn.cyan {
  background: linear-gradient(90deg, var(--cyan), rgba(71, 199, 116, 0.95));
  color: #04151d;
}

.info-section {
  margin-top: 22px;
}

.info-section h2 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 2vw, 2.1rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.info-table {
  border: 1px solid var(--line);
  border-bottom: 0;
  background: var(--surface);
}

.table-row {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.table-row.shaded {
  background: #eff1f3;
}

.table-key,
.table-value {
  padding: 12px 12px;
  font-size: 0.92rem;
}

.table-key {
  font-weight: 500;
}

.table-value {
  word-break: break-word;
}

.whois-state {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 0.92rem;
  color: var(--muted);
}

.is-hidden {
  display: none;
}

#whois-section:target {
  display: block;
}

.whois-panel .table-value a {
  color: #1265f1;
  text-decoration: underline;
}

.ping-form {
  margin-bottom: 16px;
}

.ping-label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 600;
}

.ping-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ping-input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.ping-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30, 111, 242, 0.12);
}

.ping-submit {
  min-height: 46px;
  white-space: nowrap;
}

.ping-meta {
  margin-bottom: 14px;
}

.ping-output-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.ping-output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #eff1f3;
}

.ping-output-head h3 {
  margin: 0;
  font-size: 1rem;
}

.ping-status {
  font-size: 0.82rem;
  font-weight: 700;
}

.ping-status-ok {
  color: #0f8b5f;
}

.ping-status-bad {
  color: #b52b2e;
}

.ping-output {
  margin: 0;
  padding: 16px;
  min-height: 240px;
  max-height: 420px;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 253, 0.98)),
    linear-gradient(90deg, rgba(30, 111, 242, 0.04), rgba(71, 199, 116, 0.04));
  color: #223044;
  font: 0.84rem/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre;
  word-break: normal;
  tab-size: 2;
  overscroll-behavior: contain;
}

.ping-output::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.ping-output::-webkit-scrollbar-track {
  background: #e8edf3;
}

.ping-output::-webkit-scrollbar-thumb {
  background: #9aa7b6;
  border-radius: 999px;
}

.ping-output::-webkit-scrollbar-thumb:hover {
  background: #7e8c9a;
}

.ping-state-error {
  margin-top: 10px;
  color: #b52b2e;
}

.footer {
  background: var(--footer);
  border-top: 1px solid #c3c5c8;
}

.footer-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 0;
  text-align: center;
  font-size: 0.92rem;
}

.footer a {
  color: #1265f1;
  text-decoration: underline;
}

.footer a:hover {
  color: var(--green);
}

.footer p {
  margin: 0;
}

@media (max-width: 980px) {
  .topbar-inner {
    min-height: 72px;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 0;
  }

  .menu-toggle {
    display: block;
  }

  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 10px;
    padding: 8px 0 6px;
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
  }

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

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

  .ping-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .table-row {
    grid-template-columns: 1fr;
  }

  .table-key {
    padding-bottom: 8px;
  }

  .table-value {
    padding-top: 0;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 20px, 1320px);
  }

  .topbar-inner {
    min-height: 60px;
    gap: 10px;
    padding: 8px 0;
  }

  .brand {
    max-width: calc(100% - 64px);
  }

  .brand img {
    height: 32px;
    max-width: 156px;
  }

  .page {
    padding-top: 14px;
    padding-bottom: 24px;
  }

  .breadcrumb-icon {
    margin-bottom: 10px;
  }

  .hero-card {
    padding: 16px 12px 12px;
    border-radius: 10px;
  }

  .ip-row {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }

  .ip-row h1 {
    flex: 1 1 auto;
    min-width: 0;
    font-size: clamp(1.1rem, 7vw, 1.5rem);
    line-height: 1.16;
    letter-spacing: -0.03em;
    word-break: break-word;
  }

  .copy-btn {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 8px 12px;
    font-size: 0.88rem;
  }

  .hero-copy p {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .ping-submit {
    width: 100%;
  }

  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    background: transparent;
  }

  .tool-btn {
    min-height: 42px;
    font-size: 0.86rem;
  }

  .ping-label,
  .ping-output,
  .ping-status {
    font-size: 0.88rem;
  }

  .info-section {
    margin-top: 16px;
  }

  .info-section h2 {
    margin-bottom: 8px;
    font-size: 1.2rem;
  }

  .whois-state {
    font-size: 0.88rem;
  }

  .info-table {
    border-radius: 10px;
    overflow: hidden;
  }

  .table-key,
  .table-value {
    padding-left: 10px;
    padding-right: 10px;
    font-size: 0.88rem;
  }

  .table-key {
    font-weight: 700;
  }

  .footer-inner {
    min-height: 60px;
    gap: 6px;
    padding: 10px 0;
    font-size: 0.82rem;
    line-height: 1.5;
  }
}

@media (max-width: 420px) {
  .container {
    width: min(100% - 16px, 1320px);
  }

  .brand img {
    height: 28px;
    max-width: 142px;
  }

  .menu-toggle {
    padding: 8px 6px;
  }

  .hero-card {
    padding: 14px 10px 10px;
  }

  .ip-row {
    align-items: flex-start;
  }

  .ip-row h1 {
    font-size: 1.02rem;
    line-height: 1.18;
  }

  .copy-btn {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 0.82rem;
  }

  .hero-copy p {
    font-size: 0.88rem;
  }

  .ping-submit {
    min-height: 40px;
  }

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

  .tool-btn {
    min-height: 40px;
  }

  .info-section h2 {
    font-size: 1.08rem;
  }

  .table-key,
  .table-value {
    font-size: 0.84rem;
  }

  .whois-state {
    font-size: 0.84rem;
  }
}
