:root {
    --bg: #f4f7fa;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --ink: #0f1f33;
    --ink-soft: #33475c;
    --muted: #6b7f93;
    --line: #e2e9f1;
    --line-strong: #c7d5e3;
    --brand: #0d4f77;
    --brand-2: #0e7490;
    --brand-soft: #e9f3f9;
    --large: #b45309;
    --large-soft: #fff7ed;
    --large-line: #fdba74;
    --medium: #0e7490;
    --medium-soft: #ecfeff;
    --medium-line: #67e8f9;
    --small: #475569;
    --small-soft: #f1f5f9;
    --small-line: #cbd5e1;
    --danger: #b42318;
    --danger-soft: #fef3f2;
    --shadow-card: 0 24px 60px -34px rgba(15, 31, 51, .32);
    --shadow-soft: 0 10px 30px -24px rgba(15, 31, 51, .35);
    --radius: 14px;
    --radius-lg: 18px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Inter", "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p {
    margin: 0;
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
}

svg {
    display: block;
}

::selection {
    background: rgba(14, 116, 144, .18);
}

:focus-visible {
    outline: 2px solid var(--brand-2);
    outline-offset: 3px;
}

.container {
    width: min(980px, calc(100% - 40px));
    margin: 0 auto;
}

/* ---------- 顶部背景 ---------- */

.page-top {
    position: relative;
    overflow: hidden;
    padding-bottom: 34px;
    background:
        radial-gradient(900px 420px at 8% 0%, rgba(14, 116, 144, .12), transparent 62%),
        linear-gradient(180deg, #eef6fb 0%, #f7fafc 62%, var(--bg) 100%);
}

.page-top::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(13, 79, 119, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(13, 79, 119, .055) 1px, transparent 1px);
    background-size: 34px 34px;
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .85), transparent 88%);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, .85), transparent 88%);
    pointer-events: none;
}

.page-top::after {
    content: "";
    position: absolute;
    top: -160px;
    right: -120px;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 116, 144, .1), transparent 68%);
    pointer-events: none;
}

.page-top .intro,
.page-top .search-section {
    position: relative;
    z-index: 1;
}

/* ---------- 顶部标题 ---------- */

.intro {
    padding: 52px 0 24px;
    text-align: center;
}

.intro h1 {
    font-size: clamp(1.9rem, 3.6vw, 2.5rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.02em;
}

.intro p {
    max-width: 620px;
    margin: 10px auto 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.75;
}

/* ---------- 查询表单 ---------- */

.search-section {
    padding-bottom: 0;
}

.search-card {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
    padding: 26px 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.search-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: linear-gradient(90deg, var(--brand), var(--brand-2) 55%, #38bdf8);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.field {
    min-width: 0;
}

.field label {
    display: block;
    margin-bottom: 7px;
    color: var(--ink-soft);
    font-size: 12.5px;
    font-weight: 600;
}

.field input,
.field select {
    width: 100%;
    height: 46px;
    padding: 0 13px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #fbfdff;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.field input::placeholder {
    color: #9aabbb;
}

.field input:hover,
.field select:hover {
    border-color: #a9bfd3;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--brand-2);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(14, 116, 144, .12);
}

.input-wrap {
    position: relative;
}

.select-wrap {
    position: relative;
}

.select-wrap select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 38px;
    cursor: pointer;
}

.select-wrap::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 15px;
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: translateY(-68%) rotate(45deg);
    pointer-events: none;
}

.form-hint {
    margin-top: 14px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.form-error {
    margin-top: 12px;
    padding: 9px 12px;
    border: 1px solid #fecdca;
    border-radius: 9px;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 12.5px;
}

.form-error[hidden] {
    display: none;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

.btn-primary {
    flex: 1;
    background: linear-gradient(120deg, var(--brand), var(--brand-2));
    color: #fff;
    box-shadow: 0 12px 22px -16px rgba(13, 79, 119, .9);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 26px -16px rgba(13, 79, 119, .95);
}

.btn-ghost {
    background: var(--surface);
    border-color: var(--line-strong);
    color: var(--ink-soft);
}

.btn-ghost:hover {
    border-color: var(--brand-2);
    color: var(--brand);
    background: var(--brand-soft);
}

/* ---------- 输入联想 ---------- */

.suggest-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 50;
    display: none;
    max-height: 300px;
    overflow: auto;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 20px 44px -24px rgba(15, 31, 51, .45);
}

.suggest-panel.is-open {
    display: block;
}

.suggest-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 7px;
    background: none;
    text-align: left;
    cursor: pointer;
}

.suggest-item:hover,
.suggest-item.is-active {
    background: var(--brand-soft);
}

.suggest-value {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 13.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggest-meta {
    flex: none;
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.suggest-empty {
    padding: 12px 10px;
    color: var(--muted);
    font-size: 12.5px;
}

/* ---------- 查询结果 ---------- */

.results {
    padding: 40px 0 6px;
    scroll-margin-top: 20px;
}

.results-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.results-head h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.01em;
}

.results-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 12.5px;
}

.results-meta b {
    color: var(--brand);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

.results-meta .sep {
    width: 1px;
    height: 11px;
    background: var(--line-strong);
}

.verdict {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    margin-bottom: 18px;
    padding: 18px 22px;
    border-radius: var(--radius);
    background: linear-gradient(120deg, #0a3d5c 0%, #0d4f77 55%, #0e7490 100%);
    color: #fff;
    box-shadow: 0 20px 44px -30px rgba(10, 61, 92, .9);
}

.verdict-eyebrow {
    width: 100%;
    color: rgba(255, 255, 255, .58);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .18em;
}

.verdict-level {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.05;
}

.verdict-level.level-large {
    color: #ffd7a8;
}

.verdict-level.level-medium {
    color: #a5f3fc;
}

.verdict-level.level-small {
    color: #e2e8f0;
}

.verdict-project {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.verdict-project b {
    font-size: 15px;
    font-weight: 600;
}

.verdict-project i {
    color: rgba(255, 255, 255, .64);
    font-size: 12px;
    font-style: normal;
}

.verdict-basis {
    margin-left: auto;
    color: rgba(255, 255, 255, .76);
    font-size: 12.5px;
}

.ambiguity-note {
    margin-bottom: 14px;
    padding: 9px 12px;
    border: 1px solid #bae6fd;
    border-radius: 9px;
    background: #f0f9ff;
    color: #075985;
    font-size: 12.5px;
}

.result-message {
    margin-bottom: 14px;
    padding: 9px 12px;
    border: 1px solid #fde68a;
    border-radius: 9px;
    background: #fffbeb;
    color: #92400e;
    font-size: 12.5px;
}

.result-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.result-card {
    padding: 20px 22px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.result-card.has-verdict {
    border-color: #bae6fd;
    box-shadow: 0 0 0 1px rgba(186, 230, 253, .5), var(--shadow-soft);
}

.card-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.card-titles {
    min-width: 0;
    flex: 1;
}

.card-titles h3 {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.45;
    word-break: break-word;
}

.card-titles p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12.5px;
    word-break: break-word;
}

.card-titles mark {
    padding: 0 2px;
    border-radius: 3px;
    background: #fef3c7;
    color: inherit;
}

.dot {
    margin: 0 6px;
    color: var(--line-strong);
}

.verdict-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex: none;
    gap: 1px;
    padding: 6px 13px;
    border: 1px solid;
    border-radius: 9px;
    line-height: 1.3;
}

.verdict-badge span {
    font-size: 10px;
    letter-spacing: .12em;
    opacity: .68;
}

.verdict-badge strong {
    font-size: 18px;
    font-weight: 800;
}

.verdict-badge.level-large {
    border-color: var(--large-line);
    background: var(--large-soft);
    color: var(--large);
}

.verdict-badge.level-medium {
    border-color: var(--medium-line);
    background: var(--medium-soft);
    color: var(--medium);
}

.verdict-badge.level-small {
    border-color: var(--small-line);
    background: var(--small-soft);
    color: var(--small);
}

.eval-line {
    margin-top: 10px;
    padding: 6px 10px;
    border-radius: 7px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 12px;
}

.eval-line.is-warning {
    background: #fffbeb;
    color: #92400e;
}

/* ---------- 结果表格 ---------- */

.table-wrap {
    margin-top: 14px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.scale-table {
    width: 100%;
    min-width: 700px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.scale-table thead th {
    padding: 10px 15px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    text-align: left;
}

.scale-table thead .metric-col {
    width: 160px;
}

.scale-table thead .col-large {
    color: var(--large);
}

.scale-table thead .col-medium {
    color: var(--medium);
}

.scale-table thead .col-small {
    color: var(--small);
}

.scale-table tbody th,
.scale-table tbody td {
    padding: 13px 15px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    text-align: left;
}

.scale-table tbody tr:last-child th,
.scale-table tbody tr:last-child td {
    border-bottom: 0;
}

.metric-cell {
    font-weight: 400;
}

.metric-name {
    display: block;
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.5;
}

.unit-chip {
    display: inline-block;
    margin-top: 5px;
    padding: 1px 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 11px;
}

.cell-value {
    color: var(--ink-soft);
    font-size: 13.5px;
    line-height: 1.7;
    word-break: break-word;
}

td.is-hit {
    position: relative;
}

td.cell-large.is-hit {
    background: var(--large-soft);
    box-shadow: inset 0 0 0 2px var(--large-line);
}

td.cell-medium.is-hit {
    background: var(--medium-soft);
    box-shadow: inset 0 0 0 2px var(--medium-line);
}

td.cell-small.is-hit {
    background: var(--small-soft);
    box-shadow: inset 0 0 0 2px var(--small-line);
}

td.is-hit .cell-value {
    color: var(--ink);
    font-weight: 700;
}

.hit-flag {
    display: inline-block;
    margin-left: 7px;
    padding: 1px 6px;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.6;
    vertical-align: 2px;
}

td.cell-large .hit-flag {
    color: var(--large);
}

td.cell-medium .hit-flag {
    color: var(--medium);
}

td.cell-small .hit-flag {
    color: var(--small);
}

.card-note {
    margin-top: 10px;
}

.card-note p {
    display: flex;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.card-note span {
    flex: none;
    color: var(--ink-soft);
    font-weight: 600;
}

.card-note em {
    font-style: normal;
}

.data-note {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #fde68a;
    border-radius: 9px;
    background: #fffbeb;
    color: #92400e;
    font-size: 12px;
    line-height: 1.7;
}

.data-note strong {
    display: block;
    margin-bottom: 2px;
    font-size: 12px;
}

.card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 12px;
    padding-top: 9px;
    border-top: 1px dashed var(--line);
    color: #93a4b5;
    font-size: 11px;
}

/* ---------- 空结果 ---------- */

.empty-state {
    padding: 40px 24px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .72);
    text-align: center;
}

.empty-state h3 {
    font-size: 17px;
    font-weight: 700;
}

.empty-state > p {
    max-width: 520px;
    margin: 8px auto 0;
    color: var(--muted);
    font-size: 13px;
}

.suggest-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    color: var(--muted);
    font-size: 12.5px;
}

.suggest-chip {
    padding: 5px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: #fff;
    color: var(--brand);
    font-size: 12.5px;
    cursor: pointer;
}

.suggest-chip:hover {
    border-color: var(--brand-2);
    background: var(--brand-soft);
}

/* ---------- 类别目录 ---------- */

.section {
    padding: 40px 0;
}

.directory {
    padding-bottom: 8px;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}

.section-head h2 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.01em;
}

.section-head p {
    color: var(--muted);
    font-size: 12px;
}

.directory-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.directory-card {
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.directory-card h3 {
    margin-bottom: 12px;
    font-size: 14.5px;
    font-weight: 700;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-list a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink-soft);
    font-size: 12.5px;
    transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.category-list a:hover {
    border-color: var(--brand-2);
    background: var(--brand-soft);
    color: var(--brand);
}

.count {
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 10.5px;
    font-style: normal;
    font-variant-numeric: tabular-nums;
}

.category-list a:hover .count {
    background: #fff;
    color: var(--brand-2);
}

/* ---------- 判定说明 ---------- */

.notes {
    padding-top: 0;
    padding-bottom: 40px;
}

.notes-card {
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.notes-card h2 {
    margin-bottom: 10px;
    font-size: 17px;
    font-weight: 700;
}

.notes-card li {
    position: relative;
    padding-left: 14px;
    color: var(--ink-soft);
    font-size: 12.5px;
    line-height: 1.9;
}

.notes-card li::before {
    content: "";
    position: absolute;
    top: .8em;
    left: 1px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--brand-2);
}

/* ---------- 响应式 ---------- */

@media (max-width: 760px) {
    .container {
        width: calc(100% - 32px);
    }

    .intro {
        padding: 36px 0 20px;
    }

    .intro h1 {
        font-size: 1.7rem;
    }

    .search-card {
        padding: 20px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .results {
        padding-top: 30px;
    }

    .results-head,
    .section-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .verdict {
        padding: 16px 18px;
    }

    .verdict-basis {
        width: 100%;
        margin-left: 0;
    }

    .result-card {
        padding: 16px 14px 12px;
    }

    .directory-grid {
        grid-template-columns: 1fr;
    }

    .scale-table {
        min-width: 680px;
    }

    .section {
        padding: 30px 0;
    }
}

@media (max-width: 640px) {
    .table-wrap {
        overflow: visible;
        border: 0;
        border-radius: 0;
    }

    .scale-table {
        display: block;
        min-width: 0;
        table-layout: auto;
    }

    .scale-table thead {
        display: none;
    }

    .scale-table tbody {
        display: block;
    }

    .scale-table tbody tr {
        display: block;
        margin-bottom: 10px;
        border: 1px solid var(--line);
        border-radius: 10px;
        overflow: hidden;
        background: #fff;
    }

    .scale-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .scale-table tbody th,
    .scale-table tbody td {
        display: block;
        width: auto;
        border: 0;
    }

    .scale-table tbody th {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
        border-bottom: 1px solid var(--line);
        background: var(--surface-soft);
    }

    .scale-table tbody th .metric-name {
        display: inline;
    }

    .scale-table tbody th .unit-chip {
        margin-top: 0;
    }

    .scale-table tbody td {
        position: relative;
        padding: 10px 12px 10px 62px;
        border-bottom: 1px dashed var(--line);
    }

    .scale-table tbody td:last-child {
        border-bottom: 0;
    }

    .scale-table tbody td::before {
        position: absolute;
        top: 10px;
        left: 12px;
        width: 42px;
        font-size: 11px;
        font-weight: 700;
    }

    .scale-table tbody td.cell-large::before {
        content: "大型";
        color: var(--large);
    }

    .scale-table tbody td.cell-medium::before {
        content: "中型";
        color: var(--medium);
    }

    .scale-table tbody td.cell-small::before {
        content: "小型";
        color: var(--small);
    }

    .scale-table tbody td.is-hit {
        box-shadow: none;
    }

    .scale-table tbody td.cell-large.is-hit {
        background: var(--large-soft);
        box-shadow: inset 3px 0 0 var(--large-line);
    }

    .scale-table tbody td.cell-medium.is-hit {
        background: var(--medium-soft);
        box-shadow: inset 3px 0 0 var(--medium-line);
    }

    .scale-table tbody td.cell-small.is-hit {
        background: var(--small-soft);
        box-shadow: inset 3px 0 0 var(--small-line);
    }
}

@media (max-width: 480px) {
    .intro h1 {
        font-size: 1.55rem;
    }

    .intro p {
        font-size: 13px;
    }

    .btn {
        padding: 0 16px;
    }

    .verdict-level {
        font-size: 30px;
    }

    .card-top {
        flex-wrap: wrap;
    }

    .verdict-badge {
        margin-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}

@media print {
    .page-top,
    .directory,
    .notes,
    .empty-state {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .results {
        padding: 0;
    }

    .result-card {
        break-inside: avoid;
        box-shadow: none;
    }

    .table-wrap {
        overflow: visible;
    }

    .scale-table {
        min-width: 0;
    }
}
