:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #5b667a;
  --line: #e3e8f0;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eaf0ff;
  --ok: #15803d;
  --ok-soft: #e8f7ee;
  --warn: #9a6700;
  --warn-soft: #fff6dd;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --unknown: #5b667a;
  --unknown-soft: #eef1f6;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(23, 32, 51, 0.05), 0 8px 24px rgba(23, 32, 51, 0.06);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}

a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-dark); }

.container { width: min(960px, 100% - 32px); margin-inline: auto; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; color: #fff; }

.site-header {
  padding: 16px 0 8px;
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
}
.site-name { font-weight: 640; font-size: 15px; letter-spacing: 0.2px; }

.hero { padding: 22px 0 20px; }
.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(26px, 4.5vw, 36px);
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
}
.card h2 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 640;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.ip-card { padding: 24px; }
.ip-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.ip-label {
  margin: 0;
  font-size: 14px;
  font-weight: 620;
  color: var(--muted);
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 1.7;
}
.badge-soft { background: var(--unknown-soft); color: var(--muted); }

.ip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.ip-value {
  font-size: clamp(26px, 5.2vw, 40px);
  font-weight: 720;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
  line-height: 1.25;
}
.ip-value.is-loading { color: var(--muted); font-weight: 500; font-size: 22px; }

.ip-actions { display: flex; gap: 8px; flex-shrink: 0; }

.ip-meta {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  padding: 0 16px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.06s ease;
}
.btn:hover:not(:disabled) { background: #f7f9fd; border-color: #cfd8e6; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-icon { font-size: 16px; line-height: 1; }
.btn.is-copied { background: var(--ok-soft); border-color: #b7e4c7; color: var(--ok); }

.location-line {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 640;
  line-height: 1.45;
  word-break: break-word;
}

.kv { margin: 0; display: grid; gap: 2px; }
.kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid #f0f3f8;
  min-width: 0;
}
.kv-row:first-child { border-top: 0; }
.kv dt { color: var(--muted); font-size: 13px; flex-shrink: 0; }
.kv dd {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 14px;
  font-weight: 560;
  text-align: right;
  justify-content: flex-end;
  word-break: break-word;
}
.kv dd > span { overflow-wrap: anywhere; }

.copy-mini {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  padding: 6px 6px;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}
.copy-mini:hover:not(:disabled) { background: var(--brand-soft); color: var(--brand-dark); }
.copy-mini:disabled { opacity: 0.3; cursor: not-allowed; }

.status-card h2 { margin-bottom: 10px; }
.status {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 660;
}
.status-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  flex-shrink: 0;
}
.status-note {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.status-ok { color: var(--ok); }
.status-ok .status-icon { background: var(--ok-soft); }
.status-warn { color: var(--warn); }
.status-warn .status-icon { background: var(--warn-soft); }
.status-danger { color: var(--danger); }
.status-danger .status-icon { background: var(--danger-soft); }
.status-unknown { color: var(--unknown); }
.status-unknown .status-icon { background: var(--unknown-soft); }

.hint {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12.5px;
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid #f2e2b6;
}

.browser-panel summary {
  cursor: pointer;
  font-weight: 640;
  font-size: 15px;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
}
.browser-panel summary::-webkit-details-marker { display: none; }
.browser-panel summary::after {
  content: "▾";
  color: var(--muted);
  transition: transform 0.15s ease;
}
.browser-panel[open] summary::after { transform: rotate(180deg); }
.browser-panel .kv { margin-top: 12px; }

.action-row { display: flex; }
.action-row .btn { width: 100%; }

.notice {
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 13.5px;
  line-height: 1.7;
}
.notice p { margin: 0 0 6px; }
.notice p:last-child { margin-bottom: 0; }
.notice-info {
  background: var(--brand-soft);
  border: 1px solid #cfdcff;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.notice-warn {
  background: #fffdf5;
  border: 1px solid #f0e3ba;
  color: #6b4e00;
}
.notice-error {
  background: var(--danger-soft);
  border: 1px solid #f5c2bd;
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.seo-content { padding: 34px 0 10px; }
.seo-content > h2 {
  font-size: 21px;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.seo-content > p {
  margin: 0 0 26px;
  color: #3c4759;
  font-size: 14.5px;
  text-align: justify;
}
.faq { display: grid; gap: 18px; }
.faq article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
}
.faq h3 { margin: 0 0 6px; font-size: 15.5px; }
.faq p { margin: 0; color: var(--muted); font-size: 13.5px; }

.site-footer {
  margin-top: 36px;
  padding: 22px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}
.site-footer p { margin: 0 0 4px; }
.copyright { opacity: 0.85; }

.copy-feedback {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  background: rgba(23, 32, 51, 0.92);
  color: #fff;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 60;
}
.copy-feedback.is-visible { opacity: 1; transform: translate(-50%, 0); }

.skeleton-line {
  display: inline-block;
  min-width: 120px;
  height: 1em;
  border-radius: 6px;
  background: linear-gradient(90deg, #eef1f6 25%, #f7f9fc 37%, #eef1f6 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.result[aria-busy="true"] .location-line {
  color: transparent;
  width: 58%;
  height: 1.05em;
  border-radius: 6px;
  background: linear-gradient(90deg, #eef1f6 25%, #f7f9fc 37%, #eef1f6 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .container { width: min(960px, 100% - 24px); }
  .grid, .security-grid { grid-template-columns: 1fr; }
  .hero { padding: 16px 0 16px; }
  .card { padding: 16px; }
  .ip-card { padding: 18px; }
  .ip-row { align-items: flex-start; }
  .ip-actions { width: 100%; }
  .ip-actions .btn { flex: 1; }
  .ip-value { font-size: clamp(24px, 7vw, 32px); }
  .seo-content > p { text-align: left; }
  .kv dd { max-width: 62%; }
  .kv-row { padding: 4px 0; }
  .copy-mini { min-width: 44px; min-height: 44px; }
  .browser-panel summary { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
