/* IPFix — 航图工程纸视觉系统：文字优先，图形只做背景 */
@font-face {
  font-family: 'Chakra Petch';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/chakra-petch-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: 'Chakra Petch';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/chakra-petch-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/manrope-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/manrope-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

:root {
  --paper: #e9eef3;
  --paper-2: #f5f8fa;
  --ink: #0f2233;
  --ink-2: #3c5163;
  --ink-3: #7a8b99;
  --sea: #1b5e8c;
  --fix: #c0204b;
  --amber: #e8a317;
  --clean: #17876d;
  --hair: rgba(15, 34, 51, 0.14);
  --hair-2: rgba(15, 34, 51, 0.28);
  --font-display: 'Chakra Petch', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --gut: 24px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(27, 94, 140, 0.04) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, rgba(27, 94, 140, 0.04) 0 1px, transparent 1px 28px);
}

main,
header,
footer {
  position: relative;
  z-index: 1;
}

h1,
h2,
p,
dl,
dd,
dt,
ul {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--fix);
  outline-offset: 2px;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--gut);
}

/* ---------- 通用零件 ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--hair);
}

.eyebrow.is-center {
  justify-content: center;
}

.eyebrow.is-center::after {
  display: none;
}

.card {
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: 3px;
  padding: 18px 20px 20px;
}

.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.94rem;
  letter-spacing: 0.04em;
  padding: 12px 24px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--ink);
  color: var(--paper-2);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  background: var(--sea);
  border-color: var(--sea);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--hair-2);
}

.btn-ghost:hover {
  background: rgba(27, 94, 140, 0.08);
  color: var(--sea);
  border-color: var(--sea);
}

.btn[disabled] {
  opacity: 0.5;
  cursor: progress;
}

.sk {
  display: inline-block;
  min-height: 1em;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(15, 34, 51, 0.07) 0%, rgba(15, 34, 51, 0.14) 50%, rgba(15, 34, 51, 0.07) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  color: transparent;
}

@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

/* ---------- 顶栏 ---------- */
.topbar {
  border-bottom: 1px solid var(--hair);
  background: rgba(233, 238, 243, 0.92);
}

.topbar-in {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 62px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-inline-end: auto;
}

.brand-mark {
  width: 24px;
  height: 24px;
  color: var(--fix);
  flex: none;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
}

.brand-tag {
  font-size: 0.78rem;
  color: var(--ink-3);
  padding-inline-start: 12px;
  border-inline-start: 1px solid var(--hair);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.85rem;
}

.topnav a {
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.topnav a:hover {
  color: var(--ink);
  border-bottom-color: var(--fix);
}

.lang select {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 7px 10px;
  border: 1px solid var(--hair-2);
  border-radius: 3px;
  background: var(--paper-2);
  cursor: pointer;
}

/* ---------- 首屏：搜索居中 ---------- */
.hero {
  padding: 54px 0 30px;
  text-align: center;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.55rem, 4.2vw, 2.35rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
  max-width: 26ch;
  width: 100%;
  margin: 14px auto 0;
  overflow-wrap: anywhere;
}

.hero-sub {
  margin: 12px auto 0;
  max-width: 52ch;
  width: 100%;
  color: var(--ink-2);
  font-size: 0.96rem;
  overflow-wrap: anywhere;
}

.search {
  display: flex;
  gap: 10px;
  max-width: 660px;
  margin: 30px auto 0;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--hair-2);
  border-radius: 3px;
  box-shadow: 0 2px 0 rgba(15, 34, 51, 0.05);
}

.search:focus-within {
  border-color: var(--fix);
  box-shadow: 0 0 0 3px rgba(192, 32, 75, 0.12);
}

.search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 1.02rem;
  padding: 11px 12px;
}

.search-input::placeholder {
  color: var(--ink-3);
}

.hero-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.hint {
  font-size: 0.78rem;
  color: var(--ink-3);
}

.error {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--fix);
  min-height: 1.3em;
  margin-top: 10px;
}

.badge-demo {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px solid var(--amber);
  border-radius: 3px;
  padding: 3px 8px;
}

/* ---------- IP 结果板 ---------- */
.plate {
  border-top: 1px solid var(--hair-2);
  border-bottom: 1px solid var(--hair-2);
  padding: 26px 0 22px;
  text-align: center;
}

.ip-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.plate-ip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
}

.ip-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(1.9rem, 6.6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.ip-value .sep {
  color: var(--ink-3);
}

.copy-btn {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  padding: 7px 13px;
  background: transparent;
  border: 1px solid var(--hair-2);
  border-radius: 3px;
  cursor: pointer;
  color: var(--ink-2);
}

.copy-btn:hover {
  border-color: var(--fix);
  color: var(--fix);
}

.geo-line {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  font-size: 1rem;
}

.geo-line .flag {
  font-size: 1.25rem;
  line-height: 1;
}

/* ---------- 信息面板：纯文字表格 ---------- */
.panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.panel-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hair-2);
  margin-bottom: 4px;
}

.rows {
  display: grid;
}

.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 0.92rem;
}

.row:last-child {
  border-bottom: 0;
}

.row dt {
  color: var(--ink-3);
  font-size: 0.85rem;
  white-space: nowrap;
}

.row dd {
  font-family: var(--font-mono);
  font-weight: 500;
  text-align: end;
  overflow-wrap: anywhere;
  line-break: anywhere;
}

.row dd.is-hit {
  color: var(--fix);
}

.row dd.is-clean {
  color: var(--clean);
}

/* 三态里的"未检测"：中性灰，与"未检出"（绿）明确区分——不知道 ≠ 没问题 */
.row dd.is-unk {
  color: var(--ink-3);
}

.notice {
  margin: 0 0 12px;
  padding: 8px 12px;
  border: 1px solid var(--hair);
  border-inline-start: 3px solid var(--ink-3);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 0.86rem;
  line-height: 1.5;
}

.clock {
  font-size: 1.02rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.score {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 0 10px;
}

.score-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 2.3rem;
  line-height: 1;
  color: var(--meter, var(--ink));
}

.score-unit {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.meter {
  position: relative;
  height: 12px;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  background-image: repeating-linear-gradient(90deg, rgba(15, 34, 51, 0.13) 0 3px, transparent 3px 5px);
}

.meter-fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 0;
  background-image: repeating-linear-gradient(90deg, var(--meter) 0 3px, transparent 3px 5px);
  transition: width 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.verdict {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--hair);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--meter, var(--ink));
}

/* ---------- 历史 ---------- */
.history {
  margin-top: 30px;
}

.history-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.history-bar .eyebrow {
  flex: 1;
}

.link-btn {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--hair-2);
  color: var(--ink-3);
  cursor: pointer;
  padding: 0 0 2px;
}

.link-btn:hover {
  color: var(--fix);
  border-bottom-color: var(--fix);
}

.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-item {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 6px 11px;
  border: 1px solid var(--hair-2);
  border-radius: 3px;
  background: var(--paper-2);
  cursor: pointer;
  display: inline-flex;
  gap: 9px;
  align-items: center;
}

.history-item:hover {
  border-color: var(--fix);
  color: var(--fix);
}

.history-item .h-geo {
  color: var(--ink-3);
  font-size: 0.72rem;
}

/* ---------- 判定说明 / 页脚 ---------- */
.criteria {
  margin-top: 34px;
  border-top: 2px solid var(--ink);
  padding-top: 16px;
}

.criteria ul {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.criteria li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--ink-2);
  max-width: 78ch;
}

.criteria li::before {
  content: '';
  width: 7px;
  height: 7px;
  margin-top: 8px;
  background: var(--sea);
  transform: rotate(45deg);
}

footer {
  margin-top: 40px;
  border-top: 1px solid var(--hair);
  padding: 20px 0 44px;
  font-size: 0.8rem;
  color: var(--ink-3);
  display: grid;
  gap: 6px;
  max-width: 78ch;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 响应式 ---------- */
@media (max-width: 620px) {
  :root {
    --gut: 16px;
  }

  .hero {
    padding: 34px 0 24px;
  }

  .topbar-in {
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 12px 0;
  }

  .brand {
    margin-inline-end: 0;
  }

  .topnav {
    order: 3;
    width: 100%;
  }

  .search {
    flex-wrap: wrap;
  }

.hero-title {
    font-size: clamp(1.1rem, 5.2vw, 1.45rem);
    max-width: 100%;
  }

  .hero-sub {
    font-size: 0.86rem;
    max-width: 100%;
  }

  .brand-tag {
    display: none;
  }

  .search .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .sk {
    animation: none;
    background: rgba(15, 34, 51, 0.1);
  }
}
