:root {
    color-scheme: light dark;
    --paper: #f7f7f2;
    --ink: #202722;
    --muted: #647068;
    --line: #d4d9d2;
    --accent: #225bd4;
    --accent-hover: #1748b1;
    --button-ink: #fff;
    --field: #fff;
    --error: #a12e27;
    --error-bg: #fff0eb;
    --reserved: #7e591d;
    --mono: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #171c1a;
        --ink: #edf0e9;
        --muted: #a8b3aa;
        --line: #3b463e;
        --accent: #a1bdff;
        --accent-hover: #c0d2ff;
        --button-ink: #14213d;
        --field: #1f2722;
        --error: #ffb5a6;
        --error-bg: #33211e;
        --reserved: #e3c187;
    }
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-width: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 4px; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
.page { width: min(100% - 64px, 880px); margin-inline: auto; }
.masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px 24px;
    padding-block: 28px 22px;
    border-bottom: 1px solid var(--ink);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 14px; font-weight: 600; text-decoration: none; }
.brand-icon { display: block; flex: 0 0 26px; width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 1.5; }
.language { display: flex; align-items: center; gap: 12px; font-size: 12px; white-space: nowrap; }
.language [aria-current] { font-weight: 650; }
.language .separator { color: var(--line); }
.language a { color: var(--muted); }
.language a:hover { color: var(--accent); }
.intro { padding-block: 42px 30px; }
h1 { margin: 0; font-size: clamp(36px, 6vw, 52px); font-weight: 650; letter-spacing: -.045em; line-height: 1.2; }
.search-form { margin-bottom: 38px; }
.search-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.search-input {
    width: 100%; min-width: 0; height: 56px; padding: 12px 16px;
    border: 1px solid var(--line); border-radius: 3px;
    background: var(--field); color: var(--ink);
    font: 16px / 1.5 var(--mono); appearance: none;
}
.search-input::placeholder { color: var(--muted); opacity: 1; }
.search-input:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.search-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 20px;
    min-height: 56px; padding: 12px 24px; border: 1px solid var(--accent); border-radius: 3px;
    background: var(--accent); color: var(--button-ink);
    font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.5; cursor: pointer;
}
.search-button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.search-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.form-hint { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.result { border-top: 2px solid var(--ink); }
.result-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; padding-top: 20px; }
.section-label { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.protocol { color: var(--muted); font: 12px / 1.5 var(--mono); }
.ip-address {
    margin: 16px 0 22px; font-family: var(--mono); font-size: clamp(28px, 5.8vw, 52px);
    font-weight: 500; letter-spacing: -.05em; line-height: 1.25; overflow-wrap: anywhere;
}
.ip-address.is-long { font-size: clamp(24px, 4vw, 36px); letter-spacing: -.045em; }
.tag { display: inline-block; margin-bottom: 20px; padding: 3px 9px; border: 1px solid currentColor; border-radius: 2px; color: var(--accent); font-size: 11px; font-weight: 600; }
.tag-reserved { color: var(--reserved); }
.details { margin: 0; border-top: 1px solid var(--line); }
.detail-row { display: grid; grid-template-columns: 144px minmax(0, 1fr); align-items: baseline; gap: 24px; padding-block: 16px; border-bottom: 1px solid var(--line); }
.detail-row dt { color: var(--muted); font-size: 13px; }
.detail-row dd { min-width: 0; margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.detail-row .technical { font-family: var(--mono); font-size: 13px; }
.unavailable { color: var(--muted); }
.result-note { margin: 0; padding-bottom: 24px; color: var(--muted); font-size: 14px; }
.empty-state { padding-block: 20px 28px; }
.empty-state p { margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.error-state { padding: 22px 24px; border-left: 3px solid var(--error); background: var(--error-bg); color: var(--error); }
.error-state h2 { margin: 0; font-size: 16px; font-weight: 600; }
.error-state p { margin: 8px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.error-state a { display: inline-block; margin-top: 14px; font-size: 14px; }
.footer { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px 24px; margin-top: 32px; padding-bottom: 28px; color: var(--muted); font-size: 11px; }
.footer p { margin: 0; }
.footer a { text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer .notice { line-height: 1.8; }

@media (max-width: 560px) {
    .page { width: calc(100% - 40px); }
    .masthead { padding-block: 22px 18px; }
    .intro { padding-block: 32px 24px; }
    .search-form { margin-bottom: 30px; }
    .search-button { gap: 10px; padding-inline: 16px; }
    .search-input { padding-inline: 12px; }
    .detail-row { grid-template-columns: 88px minmax(0, 1fr); gap: 16px; padding-block: 14px; }
    .ip-address { margin-top: 18px; }
    .footer { display: block; margin-top: 26px; }
    .footer .notice { margin-bottom: 12px; }
}
@media (max-width: 360px) {
    .page { width: calc(100% - 32px); }
    .brand { gap: 7px; font-size: 12px; }
    .language { gap: 8px; font-size: 11px; }
    .search-button { padding-inline: 14px; }
    .search-button svg { display: none; }
}
