:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --ink: #152238;
    --muted: #617089;
    --line: #dfe6f0;
    --primary: #2457d6;
    --primary-dark: #173da4;
    --warning-bg: #fff7df;
    --warning-line: #f2d58c;
    --danger: #b42318;
    --success: #087443;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { width: min(960px, calc(100% - 32px)); margin: 0 auto; }
.topbar { background: #101d35; color: #fff; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.topbar a { color: #fff; }
.brand { font-weight: 800; letter-spacing: .02em; }
.topbar nav a { font-size: 14px; opacity: .9; }
main.wrap { padding: 40px 0 24px; min-height: calc(100vh - 110px); }
.hero { padding: 24px 0 18px; max-width: 760px; }
.eyebrow { color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 8px 0 12px; font-size: clamp(28px, 6vw, 46px); line-height: 1.15; letter-spacing: -.03em; }
h1 strong { color: var(--primary); }
h2 { margin-top: 0; }
p { margin: 8px 0 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 28px rgba(21, 34, 56, .06); padding: 24px; margin: 18px 0; }
.narrow { max-width: 520px; margin: 48px auto; }
.form-card { max-width: 760px; }
.form-card.compact { padding: 0; border: 0; box-shadow: none; margin-bottom: 0; }
.field { display: block; margin: 20px 0; }
.field > label, .field > span, legend { display: block; font-weight: 700; margin-bottom: 8px; }
input[type="text"], input[type="url"], input[type="password"], input:not([type]) { width: 100%; border: 1px solid #c9d4e3; border-radius: 10px; padding: 13px 14px; background: #fff; color: var(--ink); font: inherit; }
input:focus { outline: 3px solid rgba(36, 87, 214, .18); border-color: var(--primary); }
small, .muted { color: var(--muted); font-size: 13px; }
.field small { display: block; margin-top: 6px; }
fieldset { border: 0; padding: 0; }
legend { padding: 0; }
.check { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid #edf1f6; cursor: pointer; }
.check:last-child { border-bottom: 0; }
.check input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--primary); flex: 0 0 auto; }
.check b, .check small { display: block; }
.consent-check { margin: 20px 0; border: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid #c8d3e4; border-radius: 10px; padding: 9px 16px; color: var(--ink); background: #fff; font: inherit; cursor: pointer; text-decoration: none; }
.button:hover { text-decoration: none; background: #f7f9fc; }
.button.primary { color: #fff; background: var(--primary); border-color: var(--primary); font-weight: 700; }
.button.primary:hover { background: var(--primary-dark); }
.button:disabled { opacity: .6; cursor: wait; }
.button.full { width: 100%; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.notice { padding: 14px 16px; border-radius: 12px; margin: 16px 0; }
.warning { background: var(--warning-bg); border: 1px solid var(--warning-line); }
.error-text { color: var(--danger); }
.success-card { border-top: 4px solid var(--success); }
.success-icon { color: var(--success); font-size: 34px; font-weight: 800; }
#probe-link { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.plain-list { padding-left: 20px; }
.errors { color: var(--danger); }
.probe-card { max-width: 680px; margin: 24px auto; }

.query-card { max-width: 760px; }
.query-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 12px; }
.query-form .field { margin: 0; }
.id-only-query { grid-template-columns: minmax(220px, 1fr) auto; max-width: 560px; }
.compact-probe { max-width: 560px; }
.selected-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.selected-tags span { border: 1px solid #cbd8f7; background: #f2f5ff; color: var(--primary-dark); border-radius: 999px; padding: 5px 10px; font-size: 13px; }
.collection-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 20px 0; }
.collection-list div { padding: 13px 15px; border-bottom: 1px solid var(--line); }
.collection-list div:last-child { border-bottom: 0; }
.collection-list b, .collection-list span { display: block; }
.collection-list span { color: var(--muted); font-size: 14px; }
.status { min-height: 24px; margin: 14px 0 0; text-align: center; color: var(--muted); }
.break-all { overflow-wrap: anywhere; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.page-heading h1 { margin-bottom: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 13px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.meta-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.meta-grid div { display: flex; flex-direction: column; gap: 3px; }
.meta-grid .span-all { grid-column: 1 / -1; }
.visit-card { box-shadow: none; }
.visit-header { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 12px; }
.data-list { display: grid; grid-template-columns: minmax(100px, 170px) 1fr; margin: 0; }
.data-list dt, .data-list dd { padding: 9px 0; border-bottom: 1px solid #edf1f6; }
.data-list dt { color: var(--muted); font-weight: 700; }
.data-list dd { margin: 0; overflow-wrap: anywhere; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }

.loader-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.spinner {
    position: relative;
    width: 68px;
    height: 68px;
    border: 6px solid #dbe4f4;
    border-top-color: var(--primary);
    border-right-color: var(--primary);
    border-radius: 50%;
    animation: probe-spin .9s linear infinite;
}
.spinner::after {
    content: "";
    position: absolute;
    inset: -14px;
    border: 2px solid rgba(36, 87, 214, .14);
    border-radius: 50%;
    animation: probe-pulse 1.7s ease-out infinite;
}
.gps-data { display: grid; gap: 8px; }
.gps-data div { display: flex; flex-direction: column; gap: 2px; }
.gps-data span { color: var(--muted); font-size: 12px; }
@keyframes probe-spin { to { transform: rotate(360deg); } }
@keyframes probe-pulse {
    0% { transform: scale(.8); opacity: 1; }
    70% { transform: scale(1.25); opacity: 0; }
    100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 1.8s; } .spinner::after { animation: none; } }
.footer { color: var(--muted); font-size: 12px; padding-bottom: 24px; }
@media (max-width: 640px) {
    main.wrap { padding-top: 24px; }
    .card { padding: 18px; border-radius: 14px; }
    .page-heading { align-items: start; flex-direction: column; }
    .page-heading .button { align-self: stretch; }
    .meta-grid { grid-template-columns: 1fr; }
    .query-form { grid-template-columns: 1fr; }
    .meta-grid .span-all { grid-column: auto; }
    .data-list { grid-template-columns: 1fr; }
    .data-list dt { border-bottom: 0; padding-bottom: 2px; }
    .data-list dd { padding-top: 0; }
}
