/* curlip.me 三端界面 · 测绘控制点视觉体系（2026-10-30 批准）
   维护：Manta <manta.ops.dstw@gmail.com>；设计依据见项目根目录 DESIGN.md。
   令牌 → 基础 → 公共组件 → 公开页 → 响应式；后台特有组件在 admin.css。 */

:root {
  color-scheme: light;
  --ground: #F1F0EB; --plate: #FBFAF7; --plate-2: #E8E6DF; --ink: #1B1D1F; --ink-2: #464C52; --ink-3: #62686E;
  --rule: #D3CFC5; --rule-strong: #A9A49A;
  --red: #C8321E; --red-ink: #B02A17; --red-hover: #A82815; --on-red: #FFFFFF; --red-tint: #F6E3DF;
  --brass: #6E5216; --brass-fill: #EADDBB;
  --ok: #2D6A3E; --warn: #8A5A00; --bad: #B42318; --ok-tint: #E2EEE4; --warn-tint: #F4E9D2; --bad-tint: #F8E4E1;
  --rail-btn: #1B1D1F; --nav: #1B1D1F; --nav-2: #25282B; --nav-ink: #D9D7D1; --nav-ink-2: #9EA2A6;
  --map-ground: #E6E4DD;
  --shadow-pop: 0 10px 28px rgba(27, 29, 31, .16), 0 2px 6px rgba(27, 29, 31, .08);
  --radius: 6px; --radius-lg: calc(var(--radius) + 4px);
  --pad: clamp(16px, 1.2vw + 10px, 26px); --gap: clamp(12px, .9vw + 8px, 22px);
  --maxw: 1360px; --touch: 36px;
  --font-ui: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --font-num: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
}
[data-theme=dark] {
  color-scheme: dark;
  --ground: #141619; --plate: #1C1F23; --plate-2: #262A2F; --ink: #ECEAE4; --ink-2: #BFC2C5; --ink-3: #9AA0A6;
  --rule: #33383E; --rule-strong: #4A5057;
  --red-ink: #FF8A73; --red-tint: #3A1F1A; --brass: #D9BC78; --brass-fill: #3A3020;
  --ok: #7CC48F; --warn: #E3B45C; --bad: #FF8A80; --ok-tint: #1D2E22; --warn-tint: #3A2F18; --bad-tint: #3B1E1C;
  --rail-btn: #0E1012; --nav: #0E1012; --nav-2: #1A1D20; --nav-ink: #D9D7D1; --nav-ink-2: #8D9298;
  --map-ground: #23272B;
  --shadow-pop: 0 10px 28px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3);
}
/* 脚本尚未设置主题时跟随系统，避免深色设备首帧闪白 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --ground: #141619; --plate: #1C1F23; --plate-2: #262A2F; --ink: #ECEAE4; --ink-2: #BFC2C5; --ink-3: #9AA0A6;
    --rule: #33383E; --rule-strong: #4A5057;
    --red-ink: #FF8A73; --red-tint: #3A1F1A; --brass: #D9BC78; --brass-fill: #3A3020;
    --ok: #7CC48F; --warn: #E3B45C; --bad: #FF8A80; --ok-tint: #1D2E22; --warn-tint: #3A2F18; --bad-tint: #3B1E1C;
    --rail-btn: #0E1012; --nav: #0E1012; --nav-2: #1A1D20; --map-ground: #23272B;
    --shadow-pop: 0 10px 28px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3);
  }
}
@media (pointer: coarse) { :root { --touch: 44px; } }
@media (min-width: 1800px) { :root { --maxw: 1720px; } }

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--ground); color: var(--ink);
  font: 400 .9375rem/1.55 var(--font-ui); font-variant-numeric: tabular-nums; caret-color: var(--red);
}
::selection { background: var(--red); color: #fff; }
a { color: var(--red-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--red-ink); outline-offset: 2px; border-radius: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: 0; text-wrap: balance; }
h2 { font-size: 1rem; }
h3 { font-size: .9375rem; }
code, pre, .num { font-family: var(--font-num); font-variant-numeric: tabular-nums slashed-zero; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 1.125rem; height: 1.125rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cross-mini { width: .875rem; height: .875rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; }
* { scrollbar-color: var(--rule-strong) transparent; scrollbar-width: thin; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
.chev { width: .875rem; height: .875rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s cubic-bezier(.2, .8, .2, 1); }
details[open] > summary .chev { transform: rotate(180deg); }
.muted { color: var(--ink-3); }

/* ---------- 通用按钮与标签 ---------- */
.btn {
  min-height: max(36px, var(--touch)); padding: 0 12px; border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--plate); color: var(--ink); font-size: .875rem; font-weight: 550; display: inline-flex; gap: 6px;
  align-items: center; justify-content: center; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-hover); border-color: var(--red-hover); }
.btn.sm { min-height: max(30px, var(--touch)); padding: 0 10px; font-size: .8125rem; }
.icon-only {
  width: max(32px, var(--touch)); height: max(32px, var(--touch)); display: inline-grid; place-items: center; flex: none;
  border: 1px solid var(--rule); border-radius: var(--radius); background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-only:hover { border-color: var(--ink); color: var(--ink); }
.icon-only:disabled { opacity: .45; cursor: progress; }
.tag {
  display: inline-flex; gap: 4px; align-items: center; min-height: 24px; padding: 0 7px; border: 1px solid var(--rule-strong);
  border-radius: 4px; font: 600 .75rem/1.2 var(--font-ui); color: var(--ink-2); white-space: nowrap;
}
.tag.ver { font-family: var(--font-num); color: var(--ink); border-color: var(--ink); }
.tag[data-kind=consensus], .tag[data-state=ok] { border-color: var(--red-ink); color: var(--red-ink); }
.tag[data-kind=correction], .tag[data-state=brass] { border-color: var(--brass); background: var(--brass-fill); color: var(--brass); }
.tag[data-kind=warn], .tag[data-state=warn] { border-color: var(--warn); background: var(--warn-tint); color: var(--warn); }
.tag[data-state=pending] { color: var(--ink-3); border-style: dashed; }
.tag.consensus { border-color: var(--red-ink); background: transparent; color: var(--red-ink); }

/* ---------- 顶部红轨 ---------- */
.rail { background: var(--red); color: var(--on-red); padding-top: var(--safe-t); }
.rail-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 10px max(var(--pad), var(--safe-r)) 10px max(var(--pad), var(--safe-l));
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand search tools"; gap: 12px 20px; align-items: center;
}
.brand { grid-area: brand; display: inline-flex; gap: 8px; align-items: center; min-height: max(36px, var(--touch)); color: inherit; text-decoration: none; font-weight: 700; font-size: 1.0625rem; white-space: nowrap; }
.brand .mark { width: 1.5rem; height: 1.5rem; stroke-width: 2; }
.brand small { font-weight: 500; font-size: .8125rem; }
.search { grid-area: search; display: flex; gap: 8px; max-width: 720px; margin: 0; }
.search input {
  flex: 1; min-width: 0; height: max(40px, var(--touch)); padding: 0 12px; border: 1px solid transparent; border-radius: var(--radius);
  background: var(--plate); color: var(--ink); font-family: var(--font-num); font-size: 1rem;
}
.search input::placeholder { color: var(--ink-3); font-family: var(--font-ui); }
.search input[aria-invalid=true] { border-color: #fff; box-shadow: 0 0 0 2px var(--rail-btn); }
.search button {
  height: max(40px, var(--touch)); padding: 0 16px; border: 0; border-radius: var(--radius); background: var(--rail-btn); color: #fff;
  font-weight: 600; cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
}
.search button:hover { background: #000; }
.rail :focus-visible { outline-color: #fff; }
.tools { grid-area: tools; display: flex; gap: 4px; align-items: center; }
.tool-link { color: #fff; text-decoration: none; font-size: .875rem; padding: 0 10px; min-height: max(36px, var(--touch)); display: inline-flex; align-items: center; border-radius: var(--radius); white-space: nowrap; }
.tool-link:hover { background: rgba(0, 0, 0, .14); }
.icon-btn {
  width: max(36px, var(--touch)); height: max(36px, var(--touch)); display: inline-grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .5); border-radius: var(--radius); background: transparent; color: #fff; cursor: pointer;
}
.icon-btn:hover { background: rgba(0, 0, 0, .14); }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border: 1px solid var(--bad); border-radius: var(--radius); background: var(--bad-tint); color: var(--ink); }
.alert .icon { color: var(--bad); margin-top: 2px; }
.alert b { display: block; color: var(--bad); }
.alert.inline { padding: 8px 12px; align-items: center; margin-bottom: 10px; }
.alert.inline b { display: inline; margin-right: 8px; }

/* ---------- 主体网格 ---------- */
.shell { max-width: var(--maxw); margin: 0 auto; padding: var(--gap) max(var(--pad), var(--safe-r)) var(--pad) max(var(--pad), var(--safe-l)); }
.lookup { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "fix"; }
.col-main { grid-area: main; display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.fix { grid-area: fix; }
@media (min-width: 1180px) {
  .lookup { grid-template-columns: minmax(0, 1.3fr) minmax(380px, 1fr); grid-template-areas: "main fix"; }
  .result { flex: 1 1 auto; }
  .lookup:has(#reference-details[open]) .fix, .lookup:has(#client-details[open]) .fix { align-self: start; position: sticky; top: 16px; }
}
@media (min-width: 1800px) { .lookup { grid-template-columns: minmax(0, 1.25fr) minmax(480px, 1fr); } }

.plate { background: var(--plate); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: var(--pad); min-width: 0; container-type: inline-size; }
.sec-head { display: flex; gap: 8px 12px; align-items: center; margin-bottom: 12px; }
.sec-head > :first-child { margin-right: auto; min-width: 0; }
.sec-sub { margin: 2px 0 0; font-size: .8125rem; color: var(--ink-3); }

/* ---------- 主结果 ---------- */
.result { display: flex; flex-direction: column; }
.result-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.ip-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.ip { display: block; font-family: var(--font-num); font-weight: 650; line-height: 1.15; letter-spacing: -.01em; overflow-wrap: anywhere; word-break: normal; font-variant-numeric: slashed-zero; }
.ip[data-len=s] { font-size: clamp(2rem, 1.1rem + 2.6vw, 3.125rem); }
.ip[data-len=m] { font-size: clamp(1.5rem, 1rem + 1.9vw, 2.375rem); }
.ip[data-len=l] { font-size: clamp(1.25rem, .9rem + 1.3vw, 1.875rem); }
.ip[data-len=xl] { font-size: clamp(1.125rem, .82rem + 1.05vw, 1.625rem); }
.copy {
  min-height: max(40px, var(--touch)); min-width: max(40px, var(--touch)); padding: 0 12px; border: 1px solid var(--ink); border-radius: var(--radius);
  background: var(--ink); color: var(--ground); font-weight: 600; display: inline-flex; gap: 6px; align-items: center; justify-content: center; cursor: pointer;
}
.copy:hover { background: var(--red); border-color: var(--red); color: #fff; }
.facts { margin: 12px 0 0; display: grid; gap: 7px; }
.fact { display: grid; grid-template-columns: 4.5em minmax(0, 1fr); gap: 10px; align-items: baseline; }
.fact dt { color: var(--ink-3); font-size: .8125rem; }
.fact dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.fact.loc dd { font-size: clamp(1.25rem, 1rem + .7vw, 1.5rem); font-weight: 650; line-height: 1.3; }
.fact .sub { color: var(--ink-2); font-weight: 400; }
.meta-line { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 10px 0 0; font-size: .8125rem; color: var(--ink-3); }
.meta-line span { overflow-wrap: anywhere; }
.meta-line [data-fallback=true] { color: var(--warn); }
@media (min-width: 1180px) { .result .meta-line { margin-bottom: 16px; } }

/* 操作按钮组：一条带分隔线的整体 */
.seg { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 16px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--plate); }
@media (min-width: 1180px) { .result .seg { margin-top: auto; } }
.seg > * { min-width: 0; }
.seg > :not(:first-child) { border-left: 1px solid var(--rule); }
.seg-btn {
  width: 100%; min-height: max(38px, var(--touch)); padding: 0 8px; border: 0; background: transparent; color: var(--ink);
  font-size: .875rem; font-weight: 550; display: flex; gap: 6px; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.seg > :first-child { border-radius: var(--radius) 0 0 var(--radius); }
.seg > :last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.seg-btn:hover { background: var(--plate-2); }
.seg-btn:disabled { opacity: .5; cursor: progress; }
.seg-btn .icon { width: 1rem; height: 1rem; color: var(--ink-2); }
.seg .short { display: none; }
.api-menu > summary .chev { width: .75rem; height: .75rem; color: var(--ink-3); }
.menu {
  position: absolute; right: -1px; top: calc(100% + 6px); z-index: 30; width: min(340px, calc(100% + 2px)); padding: 6px;
  background: var(--plate); border: 1px solid var(--rule-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop);
}
.menu-item {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--plate-2); }
.menu-item b { font-size: .875rem; font-weight: 600; }
.menu-item span, .menu-item code { font-size: .75rem; color: var(--ink-3); overflow-wrap: anywhere; }
.menu hr { border: 0; border-top: 1px solid var(--rule); margin: 4px 2px; }
.status { margin: 8px 0 0; font-size: .8125rem; color: var(--ok); }
.status:empty { margin: 0; }
.screenshot-preview { display: inline-block; margin-top: 6px; font-size: .8125rem; }

/* ---------- 折叠板（设备信息 / 逐个来源） ---------- */
.fold > summary { display: flex; gap: 8px; align-items: center; white-space: nowrap; min-height: max(36px, var(--touch)); cursor: pointer; font-weight: 600; font-size: .875rem; }
.fold > summary .hint { flex: 1 1 auto; font-weight: 400; color: var(--ink-3); font-size: .8125rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fold > summary .chev { margin-left: auto; color: var(--ink-3); }
.client.plate { padding-block: 6px; }
.meta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 6px 0 10px; font-size: .8125rem; }
.meta dt { color: var(--ink-3); }
.meta dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- 多源参考 ---------- */
.summary-line { margin: 0; padding: 9px 12px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--plate-2); font-size: .875rem; overflow-wrap: anywhere; }
.summary-line.confirmed { border-color: var(--ok); background: var(--ok-tint); }
.summary-line.disputed { border-color: var(--warn); background: var(--warn-tint); }
.summary-line.failed { border-color: var(--bad); background: var(--bad-tint); }
.src-details { margin-top: 10px; border-top: 1px solid var(--rule); }
.src-details > summary { padding-top: 6px; }
.src-tools { display: flex; justify-content: flex-end; margin: 2px 0 6px; }
.mini-switch { display: inline-flex; gap: 8px; align-items: center; min-height: max(36px, var(--touch)); font-size: .8125rem; color: var(--ink-2); cursor: pointer; }
.mini-switch input { appearance: none; width: 30px; height: 18px; margin: 0; border-radius: 9px; background: var(--rule-strong); position: relative; cursor: pointer; flex: none; }
.mini-switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; }
.mini-switch input:checked { background: var(--ink); }
.mini-switch input:checked::after { transform: translateX(12px); }
.table-wrap { position: relative; overflow-x: auto; overscroll-behavior-x: contain; }
.src-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.src-table th { text-align: left; font-weight: 500; font-size: .75rem; color: var(--ink-3); padding: 6px 8px; border-bottom: 1px solid var(--rule-strong); white-space: nowrap; }
.src-table td { padding: 7px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; overflow-wrap: anywhere; }
.src-table tr:last-child td { border-bottom: 0; }
.src-table tr.loading td { color: var(--ink-3); }
.src-name { font-weight: 600; white-space: nowrap; }
.state { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; font-size: .8125rem; color: var(--ink-2); }
.state svg { width: 22px; height: 12px; flex: none; }
.state line { stroke: var(--ink); stroke-width: 1.6; }
.state[data-s=cache] line { stroke-dasharray: 4 3; }
.state[data-s=stale] { color: var(--warn); }
.state[data-s=stale] line { stroke: var(--warn); }
.state[data-s=down] { color: var(--bad); }
.state[data-s=down] line { stroke: var(--bad); }
.state[data-s=local] line { stroke-width: 3; }
.state[data-s=pending] line { stroke: var(--ink-3); stroke-dasharray: 2 3; }
.diverge { display: inline-block; margin-left: 6px; font-size: .75rem; color: var(--warn); border: 1px solid currentColor; border-radius: 3px; padding: 0 4px; white-space: nowrap; }
.src-note { display: block; margin-top: 2px; font-size: .75rem; color: var(--ink-3); }
.refresh { width: max(28px, var(--touch)); height: max(28px, var(--touch)); display: inline-grid; place-items: center; border: 0; border-radius: var(--radius); background: transparent; color: var(--ink-3); cursor: pointer; }
.refresh:hover { background: var(--plate-2); color: var(--ink); }
.refresh:disabled { opacity: .45; cursor: progress; }
.refresh .icon { width: 1rem; height: 1rem; }
.full-only { display: none; }
.full-details .full-only { display: table-cell; }
@container (max-width: 600px) {
  .src-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .src-table, .src-table tbody { display: block; }
  .src-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name act" "state act" "loc loc" "net net"; gap: 2px 10px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
  .src-table tr:last-child { border-bottom: 0; }
  .src-table td { display: block; padding: 0; border: 0; }
  .src-table td.c-name { grid-area: name; }
  .src-table td.c-state { grid-area: state; }
  .src-table td.c-act { grid-area: act; align-self: center; }
  .src-table td.c-loc { grid-area: loc; font-weight: 500; margin-top: 3px; }
  .src-table td.c-isp, .src-table td.c-asn { grid-area: net; color: var(--ink-2); }
  .src-table td.c-isp { display: none; }
  .full-details .src-table td.c-isp, .full-details .src-table td.c-asn, .full-details .src-table td.full-only { display: block; grid-area: auto; grid-column: 1 / -1; color: var(--ink-2); }
  .full-details .src-table td.full-only:empty { display: none; }
  .src-table td:empty { display: none; }
}

/* ---------- 来源交汇：交汇图与地图共用同一块固定区域 ---------- */
.fix { display: flex; flex-direction: column; }
.tabs { display: inline-flex; padding: 2px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--plate-2); }
.tabs button { min-height: max(28px, var(--touch)); padding: 0 12px; border: 0; border-radius: calc(var(--radius) - 2px); background: transparent; color: var(--ink-2); font-size: .8125rem; font-weight: 550; cursor: pointer; }
.tabs button[aria-selected=true] { background: var(--plate); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.fix-stage { position: relative; flex: 1 1 auto; display: grid; min-height: clamp(220px, 34vh, 380px); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--plate); }
.fix-stage > * { grid-area: 1 / 1; min-width: 0; min-height: 0; }
.fixfig { margin: 0; display: flex; flex-direction: column; gap: 6px; padding: 12px; }
.fixsvg { display: block; flex: 1 1 auto; width: 100%; height: 100%; min-height: 0; overflow: visible; }
.fx-orbit { fill: none; stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 4; }
.fx-ray { stroke: var(--ink); stroke-width: 1.4; }
.fx-ray.off { stroke: var(--warn); stroke-dasharray: 5 3; }
.fx-ray.pending { stroke: var(--ink-3); stroke-dasharray: 2 4; }
.fx-ray.down { stroke: var(--ink-3); }
.fx-miss { fill: var(--plate); stroke: var(--warn); stroke-width: 1.4; }
.fx-stn { fill: var(--plate); stroke: var(--ink); stroke-width: 1.4; }
.fx-stn.down { stroke: var(--ink-3); }
.fx-label { font: 500 12px var(--font-ui); fill: var(--ink-2); }
.fx-label.down { fill: var(--ink-3); text-decoration: line-through; }
.fx-cross line { stroke: var(--red); stroke-width: 2.4; stroke-linecap: square; }
.fx-cross circle { fill: none; stroke: var(--red); stroke-width: 1.6; }
.fx-plate { fill: var(--brass-fill); stroke: var(--brass); stroke-width: 1.2; }
@media (prefers-reduced-motion: no-preference) {
  .fx-ray.pending { animation: fx-dash 1.2s linear infinite; }
  @keyframes fx-dash { to { stroke-dashoffset: -12; } }
  .mini-switch input::after { transition: transform .18s cubic-bezier(.2, .8, .2, 1); }
}
.fixfig figcaption { font-size: .8125rem; color: var(--ink-2); text-align: center; }
.fixfig figcaption b { color: var(--ink); }
.map-panel { display: grid; background: var(--map-ground); }
.map-canvas { display: grid; min-height: 0; }
.map-canvas > * { grid-area: 1 / 1; }
.map-canvas iframe { width: 100%; height: 100%; min-height: 220px; border: 0; display: block; }
.map-placeholder { display: grid; place-content: center; justify-items: center; gap: 8px; padding: 16px; text-align: center; }
.map-placeholder .icon { width: 1.75rem; height: 1.75rem; color: var(--red); }
.map-placeholder strong { font-size: .9375rem; overflow-wrap: anywhere; }
.map-placeholder p { margin: 0; font-size: .8125rem; color: var(--ink-3); }
.map-close { position: absolute; right: 8px; top: 8px; z-index: 2; }
.map-status { position: absolute; left: 8px; bottom: 8px; right: 8px; margin: 0; padding: 4px 8px; border-radius: var(--radius); background: var(--warn-tint); color: var(--ink); font-size: .75rem; }
.coord { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 12px 0 10px; font-size: .8125rem; }
.coord dt { color: var(--ink-3); }
.coord dd { margin: 0; overflow-wrap: anywhere; }
.map-reference { margin: 12px 0 10px; font-size: .8125rem; }
.map-reference p, .coord-note { margin: 4px 0 8px; font-size: .75rem; color: var(--ink-3); }
.map-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.map-links .btn { font-size: .8125rem; padding: 0 4px; min-height: max(32px, var(--touch)); }
.map-links .btn .icon { width: .875rem; height: .875rem; }
.fine { margin: 8px 0 0; font-size: .75rem; color: var(--ink-3); }
.foot {
  max-width: var(--maxw); margin: 0 auto; padding: 4px max(var(--pad), var(--safe-r)) calc(14px + var(--safe-b)) max(var(--pad), var(--safe-l));
  display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .75rem; color: var(--ink-3);
}
.foot .about { max-width: 100%; }

/* 电脑矮屏（如 1366×768）收紧纵向间距，保证折叠状态一屏放下 */
@media (min-width: 1180px) and (max-height: 820px) {
  :root { --pad: 16px; --gap: 12px; }
  .rail-inner { padding-top: 8px; padding-bottom: 8px; }
  .ip[data-len=s] { font-size: 2.5rem; }
  .facts { gap: 4px; margin-top: 8px; }
  .fix-stage { min-height: 200px; }
  .meta-line { margin-top: 6px; gap: 2px 10px; }
  .result .meta-line { margin-bottom: 10px; }
  .result-head { margin-bottom: 4px; }
  .ip-line { padding-bottom: 10px; }
  .alert.inline { padding: 6px 12px; }
  .foot { padding-bottom: 8px; }
}

/* ---------- 手机 ---------- */
@media (max-width: 767px) {
  body { font-size: 1rem; }
  .rail-inner { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand tools" "search search"; gap: 8px; padding-top: 6px; padding-bottom: 12px; }
  .brand small { display: none; }
  .search { max-width: none; }
  .tool-link { padding: 0 8px; }
  .shell { padding-top: 12px; }
  .ip-line { gap: 10px; padding-bottom: 12px; }
  .ip[data-len=m] { font-size: 1.25rem; }
  .ip[data-len=l] { font-size: 1.1875rem; }
  .result { position: relative; }
  .result:has(.ip[data-len=xl]) .result-head { padding-right: calc(max(40px, var(--touch)) + 8px); min-height: max(40px, var(--touch)); }
  .result:has(.ip[data-len=xl]) .ip-line { grid-template-columns: minmax(0, 1fr); }
  .result:has(.ip[data-len=xl]) .copy { position: absolute; top: var(--pad); right: var(--pad); }
  .copy span { display: none; }
  .fact { grid-template-columns: 3.6em minmax(0, 1fr); gap: 8px; }
  .fact.loc { grid-template-columns: 1fr; }
  .fact.loc dt { display: none; }
  .fact .sub { display: none; }
  .meta-line { display: none; }
  .meta-line:has([data-fallback=true]) { display: flex; margin-top: 8px; }
  .meta-line:has([data-fallback=true]) span:not([data-fallback=true]) { display: none; }
  .result .seg { margin-top: 12px; }
  .seg-btn { padding: 0 4px; font-size: .8125rem; gap: 4px; }
  .seg .long { display: none; }
  .seg .short { display: inline; }
  .menu { width: calc(100% + 2px); }
  .fix-stage { min-height: 236px; }
  .tabs button { padding: 0 10px; }
}
@media (max-width: 359px) { .seg-btn .icon { display: none; } }

/* 手机横屏：左 IP、右字段，操作按钮组通栏 */
@media (orientation: landscape) and (max-height: 520px) and (max-width: 1179px) {
  .rail-inner { padding-top: 6px; padding-bottom: 6px; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand search tools"; }
  .shell { padding-top: 10px; }
  .result { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); grid-template-areas: "head facts" "ip facts" "meta meta" "seg seg" "status status"; column-gap: 20px; }
  .result-head { grid-area: head; }
  .ip-line { grid-area: ip; border-bottom: 0; padding-bottom: 0; }
  .facts { grid-area: facts; margin-top: 0; align-self: start; }
  .meta-line { grid-area: meta; }
  .result .seg { grid-area: seg; margin-top: 10px; }
  .status { grid-area: status; }
}

/* ---------- 错误页 ---------- */
.center-page { min-height: calc(100dvh - 64px); display: grid; place-items: center; padding: var(--pad); }
.err { text-align: center; max-width: 520px; }
.err .err-mark { width: 4rem; height: 4rem; color: var(--red); stroke-width: 1.4; }
.err .code { display: block; margin-top: 8px; font: 650 2.5rem/1 var(--font-num); color: var(--ink); }
.err h1 { font-size: 1.5rem; margin-top: 8px; }
.err p { color: var(--ink-2); }
.err .links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

@media print {
  .rail .search, .tools, .seg, .src-tools, .refresh, .tabs, .map-links { display: none !important; }
}
