/* IPScope — 自包含样式：无外部字体、无外部资源，深浅主题自适应 */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e3e6eb;
  --text: #17191f;
  --muted: #69707f;
  --accent: #2563eb;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(37, 99, 235, 0.09);
  --warn-soft: rgba(180, 83, 9, 0.1);
  --warn: #b45309;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --mono: ui-monospace, "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1017;
    --surface: #151a23;
    --surface-2: #1b2230;
    --border: #242c3b;
    --text: #e7eaf0;
    --muted: #8d95a5;
    --accent: #6395ff;
    --accent-contrast: #0b1020;
    --accent-soft: rgba(99, 149, 255, 0.13);
    --warn-soft: rgba(245, 165, 36, 0.12);
    --warn: #f5a524;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1017;
  --surface: #151a23;
  --surface-2: #1b2230;
  --border: #242c3b;
  --text: #e7eaf0;
  --muted: #8d95a5;
  --accent: #6395ff;
  --accent-contrast: #0b1020;
  --accent-soft: rgba(99, 149, 255, 0.13);
  --warn-soft: rgba(245, 165, 36, 0.12);
  --warn: #f5a524;
  --shadow: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1020px; margin: 0 auto; padding: 0 20px; }

/* 顶栏 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.05rem; color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand svg { display: block; }

/* 主视觉 */
.hero {
  text-align: center;
  padding: 52px 0 36px;
  background: radial-gradient(560px 220px at 50% 0%, var(--accent-soft), transparent 70%);
}
.hero-label { margin: 0 0 8px; color: var(--muted); font-size: 0.95rem; letter-spacing: 0.06em; }
.ip-line { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.ip-value {
  font-family: var(--mono);
  font-size: clamp(1.6rem, 5.5vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  word-break: break-all;
}
.badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.badge {
  padding: 4px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.85rem; color: var(--muted);
}
.badge.accent { background: var(--accent-soft); border-color: transparent; color: var(--accent); }

/* 卡片栅格：两列瀑布式排布——每列内部各自紧凑堆叠，卡片高度互不牵制，不会出现错位空洞 */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 16px;
  padding-bottom: 48px;
}
.col { display: grid; gap: 16px; min-width: 0; }
@media (max-width: 780px) {
  .grid { grid-template-columns: 1fr; }
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.card h2 {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
}
.card-wide { grid-column: 1 / -1; }

/* 键值列表 */
dl.kv {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(96px, max-content) 1fr;
  column-gap: 18px;
  row-gap: 8px;
}
dl.kv dt { color: var(--muted); font-size: 0.9rem; }
dl.kv dd { margin: 0; font-size: 0.95rem; overflow-wrap: anywhere; }

.mono { font-family: var(--mono); font-size: 0.9em; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.hint {
  margin: 10px 0 0;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.88rem;
}
.hint.warn { background: var(--warn-soft); color: var(--warn); }

/* 按钮与输入 */
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 7px 14px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, filter 0.15s;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn.primary:hover { filter: brightness(1.07); background: var(--accent); }

input[type="text"] {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 14px;
  font: inherit;
  font-family: var(--mono);
  font-size: 0.92rem;
}
input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }

.lookup-form { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.lookup-form input { flex: 1; min-width: 220px; }

/* 隐私检测块 */
.test-block { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.test-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }

/* 代码与表格 */
pre.code {
  margin: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.7;
}

table.headers { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.headers td { padding: 7px 10px; border-top: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
table.headers tr:first-child td { border-top: none; }
table.headers td:first-child { color: var(--muted); font-family: var(--mono); font-size: 0.85rem; white-space: nowrap; }

/* 页脚 */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0 32px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
