:root {
  --ipq-card: #fff;
  --ipq-text: #111827;
  --ipq-muted: #667085;
  --ipq-faint: #98a2b3;
  --ipq-blue: #2f6bff;
  --ipq-red: var(--site-status-red);
}

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

.ipq-page {
  width: min(1120px, 92vw);
  margin: 18px auto 72px;
  color: var(--ipq-text);
}

/* 与首页一致的搜索框 */
.centerBox {
  position: relative;
  max-width: 444px;
  margin: 0 auto 38px;
  padding: 6px 6px 6px 20px;
  display: flex;
  align-items: center;
  background: var(--ipq-card);
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(17, 24, 39, .05);
  transition: all .3s cubic-bezier(.4, 0, .2, 1);
  cursor: text;
}

.centerBox:hover {
  border-color: var(--ipq-blue);
  box-shadow: 0 16px 40px rgba(47, 107, 255, .25);
  transform: translateY(-1px);
}

.centerBox:focus-within { box-shadow: 0 12px 30px rgba(47, 107, 255, .15); }

.ipInput {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding-right: 156px;
  color: #1f2937;
  background: transparent;
  border: 1px solid transparent;
  outline: none;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.ipInput::placeholder { color: #94a3b8; font-weight: 500; }

.searchActions {
  position: absolute;
  right: 6px;
  top: 50%;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transform: translateY(-50%);
}

.runBtnWrap,
.captureBtnWrap { position: relative; display: inline-flex; align-items: center; }

.runBtn,
.capture-shot-btn {
  width: 74px;
  height: 46px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--ipq-blue), #1a56db);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(47, 107, 255, .25);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.runBtn:hover,
.capture-shot-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(47, 107, 255, .35); }
.runBtn:disabled,
.capture-shot-btn:disabled { cursor: wait; opacity: .72; }

.actionIcon { position: relative; display: inline-block; color: currentColor; }
.actionIcon--search { width: 20px; height: 20px; }
.actionIcon--search::before,
.actionIcon--search::after { content: ""; position: absolute; box-sizing: border-box; }
.actionIcon--search::before {
  left: 1px;
  top: 1px;
  width: 14px;
  height: 14px;
  border: 3px solid currentColor;
  border-radius: 50%;
}
.actionIcon--search::after {
  right: 0;
  bottom: 0;
  width: 8px;
  height: 3px;
  background: currentColor;
  border-radius: 999px;
  transform: rotate(45deg);
}

.actionIcon--camera {
  width: 26px;
  height: 19px;
  border: 2.4px solid currentColor;
  border-radius: 4px;
}
.actionIcon--camera::before,
.actionIcon--camera::after { content: ""; position: absolute; box-sizing: border-box; }
.actionIcon--camera::before {
  left: 7px;
  top: 4px;
  width: 8px;
  height: 8px;
  border: 2.2px solid currentColor;
  border-radius: 50%;
}
.actionIcon--camera::after {
  left: 5px;
  top: -5px;
  width: 9px;
  height: 4px;
  background: transparent;
  border: 2.2px solid currentColor;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
}

.ipq-status {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
}

/* 只保留一个结果大框，框内全部用文字排版 */
.ipq-panel {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  background: var(--ipq-card);
  border: 1px solid #e1e6ef;
  border-radius: 14px;
  box-shadow: 0 12px 34px rgba(15, 23, 42, .055);
}

.ipq-row {
  min-height: 56px;
  padding: 0;
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  align-items: stretch;
  column-gap: 0;
  background: #fff;
}

.ipq-row-long { min-height: 58px; }
.ipq-row:nth-child(even) { background: #f6f8fc; }

.ipq-key {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  color: var(--site-data-label-color);
  background: transparent;
  font-family: var(--font);
  font-size: var(--site-data-label-size);
  font-weight: var(--site-data-label-weight);
  line-height: 1.7;
  text-align: left;
}

.ipq-value {
  min-width: 0;
  padding: 11px 22px;
  display: flex;
  align-items: center;
  color: var(--site-data-value-color);
  font-family: var(--font);
  font-size: var(--site-data-value-size);
  font-weight: var(--site-data-value-weight);
  line-height: 1.8;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.ipq-address { color: var(--site-data-value-color); }
.ipq-owner-value { gap: 10px; }
.ipq-type-item { font-weight: var(--site-data-value-weight); }
.ipq-type-good { color: var(--site-status-blue); }
.ipq-type-isp { color: var(--site-status-blue); }
.ipq-type-neutral { color: #172033; }
.ipq-type-risk { color: var(--site-status-red); }
.ipq-location { display: flex; align-items: center; }
.ipq-country-flag {
  width: 18px;
  height: 13px;
  margin-right: 8px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .06);
}
.ipq-text-group { display: flex; align-items: center; flex-wrap: nowrap; row-gap: 8px; }
.ipq-text-item { white-space: nowrap; }
.ipq-separator { padding: 0 8px; color: #c2c8d2; font-weight: 400; }
.ipq-status-value { font-weight: var(--site-data-value-weight); }
.ipq-status-value.yes { color: var(--ipq-red); }
.ipq-status-value.no { color: var(--ipq-text); }
.ipq-status-value.unknown { color: var(--ipq-faint); }

.ipq-loading .ipq-value,
.ipq-loading .ipq-address,
.ipq-loading .ipq-status-value { color: var(--ipq-faint); }
.ipq-loading .ipq-type-item { color: var(--ipq-faint); }

/* 公开历史：采用平铺表格，不额外叠加卡片 */
.ipq-public-sections {
  width: min(900px, 100%);
  margin: 48px auto 0;
}

.ipq-history-section,
.ipq-map-section { margin-top: 42px; }

.ipq-public-sections > :first-child { margin-top: 0; }

.ipq-section-heading {
  min-height: 46px;
  padding: 0 2px 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #dfe5ee;
}

.ipq-section-heading h2 {
  margin: 0;
  color: var(--ipq-text);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
}

.ipq-section-heading span {
  color: #8a94a4;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
}

.ipq-table-scroll { width: 100%; overflow-x: auto; }

.ipq-history-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--ipq-text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.ipq-history-table th,
.ipq-history-table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
}

.ipq-history-table th {
  color: #667085;
  background: #f4f6fa;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.ipq-history-table td {
  border-bottom: 1px solid #edf0f5;
  font-weight: 500;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.ipq-history-table tr:last-child td { border-bottom: 0; }
.ipq-history-table th:nth-child(1) { width: 13%; }
.ipq-history-table th:nth-child(2) { width: 20%; }
.ipq-history-table th:nth-child(3) { width: 29%; }
.ipq-history-table th:nth-child(4),
.ipq-history-table th:nth-child(5) { width: 19%; }

.ipq-history-asn { color: var(--ipq-blue); font-weight: 500; }
.ipq-history-current { color: #168253; font-weight: 500; }
.ipq-table-message { height: 74px; color: #8a94a4; text-align: center !important; }

.ipq-map-heading { align-items: flex-end; }
.ipq-map-heading > div { min-width: 0; }
.ipq-map-heading > div > span { display: block; margin-top: 3px; }
.ipq-map-coordinate { flex: 0 0 auto; font-variant-numeric: tabular-nums; }

.ipq-map-frame {
  position: relative;
  width: 100%;
  height: 310px;
  margin-top: 16px;
  overflow: hidden;
  background: #eef1f5;
  border: 1px solid #dfe5ee;
  border-radius: 10px;
}

.ipq-map-frame .leaflet-control-attribution {
  padding: 2px 5px;
  font-family: var(--font);
  font-size: 10px;
  line-height: 1.25;
  background: rgba(255, 255, 255, .84);
}

.ipq-map-frame iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.ipq-map-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #8a94a4;
  font-size: 13px;
  font-weight: 500;
}

html[data-site-theme="dark"] .centerBox,
html[data-site-theme="dark"] .ipq-panel { background: var(--surface-card); border-color: var(--border-soft); }
html[data-site-theme="dark"] .ipInput { color: var(--text-strong); background: transparent !important; }
html[data-site-theme="dark"] .ipq-key { color: var(--text-soft); }
html[data-site-theme="dark"] .ipq-value,
html[data-site-theme="dark"] .ipq-status-value.no { color: var(--text-strong); }
html[data-site-theme="dark"] .ipq-separator { color: var(--text-faint); }
html[data-site-theme="dark"] .ipq-type-good,
html[data-site-theme="dark"] .ipq-type-isp { color: var(--site-status-blue); }
html[data-site-theme="dark"] .ipq-type-neutral { color: #F2F5FA; }
html[data-site-theme="dark"] .ipq-type-risk { color: var(--site-status-red); }
html[data-site-theme="dark"] .ipq-row { background: var(--surface-card); }
html[data-site-theme="dark"] .ipq-key { background: transparent; }
html[data-site-theme="dark"] .ipq-row:nth-child(even) { background: var(--surface-hover); }
html[data-site-theme="dark"] .ipq-section-heading { border-color: var(--border-soft); }
html[data-site-theme="dark"] .ipq-section-heading h2,
html[data-site-theme="dark"] .ipq-history-table { color: var(--text-strong); }
html[data-site-theme="dark"] .ipq-section-heading span,
html[data-site-theme="dark"] .ipq-table-message { color: var(--text-soft); }
html[data-site-theme="dark"] .ipq-history-table th { color: var(--text-soft); background: var(--surface-soft); }
html[data-site-theme="dark"] .ipq-history-table td { border-color: var(--border-soft); }
html[data-site-theme="dark"] .ipq-map-frame { background: var(--surface-soft); border-color: var(--border-soft); }

@media (max-width: 680px) {
  .ipq-page { width: min(100% - 28px, 1120px); margin-top: 14px; }
  .centerBox { max-width: 100%; padding-left: 12px; padding-right: 4px; }
  .ipInput { padding-right: 66px; font-size: 15px; }
  .captureBtnWrap { display: none; }
  .runBtn,
  .capture-shot-btn { width: 54px; height: 44px; }
  .actionIcon--search { width: 18px; height: 18px; }
  .actionIcon--camera { width: 24px; height: 17px; }
  .ipq-panel { padding: 0; border-radius: 12px; }
  .ipq-row {
    min-height: 0;
    padding: 0;
    grid-template-columns: 104px minmax(0, 1fr);
    column-gap: 0;
    align-items: stretch;
  }
  .ipq-key { padding: 11px 12px; justify-content: flex-start; text-align: left; }
  .ipq-value { padding: 11px 14px; line-height: 1.75; }
  .ipq-text-group { flex-wrap: wrap; }
  .ipq-separator { padding: 0 9px; }
  .ipq-public-sections { margin-top: 36px; }
  .ipq-history-section,
  .ipq-map-section { margin-top: 34px; }
  .ipq-section-heading { padding-bottom: 10px; align-items: flex-start; }
  .ipq-section-heading h2 { font-size: 17px; }
  .ipq-history-table th,
  .ipq-history-table td { padding: 12px 13px; }
  .ipq-map-heading { align-items: flex-end; }
  .ipq-map-frame { height: 250px; margin-top: 12px; border-radius: 8px; }
}
