.bd {
    --bd-blue: #2463d4;
    --bd-blue-soft: #edf3fd;
    --bd-ink: #253247;
    --bd-muted: #66758b;
    --bd-line: #e1e7f0;
    --bd-hit: #ffe9b0;
    --bd-active: #ffb347;
    max-width: 1440px;
    min-height: 80vh;
    margin: 0 auto;
    padding: 24px 32px 60px;
    box-sizing: border-box;
    background: #f6f8fc;
    color: var(--bd-ink);
    font-size: 14px;
    line-height: 1.6;
}
.bd * { box-sizing: border-box; }
.bd [hidden] { display: none !important; }
.bd h1 { margin: 0 0 6px; font-size: 28px; line-height: 1.4; }
.bd h2 { margin: 0 0 10px; font-size: 18px; }
.bd h3 { margin: 0 0 8px; font-size: 15px; }
.bd p { margin: 4px 0 10px; }
.bd button, .bd input { font: inherit; }
.bd-muted { color: var(--bd-muted); font-size: 13px; }
.bd-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.bd-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.bd-back { color: var(--bd-muted); text-decoration: none; }
.bd-back::before { content: "← "; }
.bd-back:hover { color: var(--bd-blue); }

.bd-button {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 7px 16px; border: 1px solid #cbd5e3; border-radius: 7px;
    background: #fff; color: var(--bd-ink); text-decoration: none; cursor: pointer;
}
.bd-button:hover { border-color: var(--bd-blue); color: var(--bd-blue); }
.bd-button:disabled { opacity: .55; cursor: not-allowed; }
.bd-primary { border-color: var(--bd-blue); background: var(--bd-blue); color: #fff; }
.bd-primary:hover { background: #1d54b8; color: #fff; }
.bd-large { min-width: 220px; padding: 11px 28px; font-size: 16px; border-radius: 24px; }
.bd-icon-button { border: 0; background: none; color: var(--bd-muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.bd-icon-button:hover { color: #c0392b; }
.bd-link-button { border: 0; background: none; color: var(--bd-muted); cursor: pointer; padding: 0; }
.bd-link-button:hover { color: #c0392b; }

.bd-card { margin-bottom: 16px; padding: 22px 24px; border: 1px solid var(--bd-line); border-radius: 10px; background: #fff; }
.bd-hero { margin: 8px 0 20px; text-align: center; }
.bd-lead { color: var(--bd-muted); font-size: 15px; }
.bd-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.bd-features ul { margin: 0; padding-left: 18px; color: var(--bd-muted); }
.bd-features li { margin: 4px 0; }
.bd-features h2 { font-size: 16px; }

.bd-field { display: flex; align-items: center; gap: 12px; max-width: 620px; margin-bottom: 18px; }
.bd-label { flex: 0 0 auto; font-weight: 600; }
.bd-field input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid #cbd5e3; border-radius: 7px; }
.bd-field input:focus { outline: 2px solid var(--bd-blue-soft); border-color: var(--bd-blue); }

.bd-uploads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 8px; }
.bd-upload h3 small { margin-left: 6px; color: var(--bd-muted); font-weight: 400; font-size: 13px; }
.bd-drop {
    padding: 26px 16px; border: 1.5px dashed #b9c8dd; border-radius: 10px;
    background: #fbfcff; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.bd-drop:hover, .bd-drop:focus-visible, .bd-drop.is-over { border-color: var(--bd-blue); background: var(--bd-blue-soft); outline: none; }
.bd-drop p { margin: 2px 0; }
.bd-files { margin: 10px 0 0; padding: 0; list-style: none; }
.bd-files li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--bd-line); border-radius: 7px; margin-bottom: 6px; background: #fff; }
.bd-file-type { flex: 0 0 auto; padding: 1px 6px; border-radius: 4px; background: var(--bd-blue-soft); color: var(--bd-blue); font-size: 11px; font-weight: 600; }
.bd-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bd-group { margin: 18px 0 0; padding: 0; border: 0; min-width: 0; }
.bd-group legend { padding: 0 0 8px 10px; border-left: 3px solid var(--bd-blue); font-weight: 600; font-size: 15px; line-height: 1.2; margin-bottom: 8px; }
.bd-group:disabled { opacity: .5; }
.bd-dimensions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 6px; }
.bd-check { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid #cbd5e3; border-radius: 8px; cursor: pointer; }
.bd-check:has(input:checked) { border-color: var(--bd-blue); background: var(--bd-blue-soft); }
.bd-check.is-disabled { opacity: .5; cursor: not-allowed; }
.bd-check input { width: 16px; height: 16px; accent-color: var(--bd-blue); }
.bd-threshold-line { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.bd-threshold-line output { padding: 2px 10px; border-radius: 6px; background: var(--bd-blue-soft); color: var(--bd-blue); font-weight: 600; }
.bd input[type=range] { width: 100%; accent-color: var(--bd-blue); }
.bd-range-ends { display: flex; justify-content: space-between; color: var(--bd-muted); font-size: 12px; }
.bd-example { margin: 10px 0 4px; padding: 12px 14px; border-radius: 8px; background: #f6f8fc; line-height: 1.9; }
.bd-example span { margin-right: 4px; }
.bd-example .is-hit { background: var(--bd-hit); border-bottom: 2px solid var(--bd-active); }
.bd-form-error { margin-top: 14px; padding: 9px 12px; border-radius: 7px; background: #fdecea; color: #b3261e; }
.bd-submit { margin-top: 20px; text-align: center; }
.bd-submit p { margin-top: 10px; }
.bd-submit .bd-cost { margin: 0 0 12px; }
.bd-cost strong { color: var(--bd-blue); }
.bd-access { padding: 24px; text-align: center; }

.bd-faq details { padding: 10px 0; border-top: 1px solid var(--bd-line); }
.bd-faq details:first-of-type { border-top: 0; }
.bd-faq summary { cursor: pointer; font-weight: 600; }
.bd-faq details p { margin: 8px 0 0; color: var(--bd-muted); }
.bd-risk { margin: 4px 0 0; padding: 10px 14px; border-radius: 8px; background: #fff8e6; color: #7a5b12; font-size: 13px; }

.bd-dialog { width: min(720px, 92vw); max-height: 80vh; padding: 20px 24px; border: 0; border-radius: 12px; color: var(--bd-ink); font-size: 14px; }
.bd-dialog::backdrop { background: rgba(23, 32, 51, .45); }
.bd-dialog-head { display: flex; justify-content: space-between; align-items: center; }
.bd-dialog h2 { margin: 0 0 8px; font-size: 18px; }
.bd-history { margin: 0; padding: 0; list-style: none; }
.bd-history li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--bd-line); }
.bd-history-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--bd-blue); text-decoration: none; font-weight: 600; }
.bd-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }

.bd-tag { display: inline-block; flex: 0 0 auto; padding: 1px 8px; border-radius: 10px; background: #eef1f6; color: var(--bd-muted); font-size: 12px; white-space: nowrap; }
.bd-tag--completed, .bd-tag--near { background: #e7f5ee; color: #1c7a4c; }
.bd-tag--failed, .bd-tag--same { background: #fdecea; color: #b3261e; }
.bd-tag--queued, .bd-tag--running { background: var(--bd-blue-soft); color: var(--bd-blue); }

/* 结果页 */
.bd-result-head { margin-bottom: 16px; }
.bd-state { text-align: center; padding: 40px 24px; }
.bd-spinner { width: 34px; height: 34px; margin: 0 auto 14px; border: 3px solid var(--bd-blue-soft); border-top-color: var(--bd-blue); border-radius: 50%; animation: bd-spin 1s linear infinite; }
@keyframes bd-spin { to { transform: rotate(360deg); } }

.bd-table-wrap { overflow-x: auto; }
.bd-table { width: 100%; border-collapse: collapse; }
.bd-table th, .bd-table td { padding: 9px 12px; border-bottom: 1px solid var(--bd-line); text-align: left; vertical-align: top; }
.bd-table thead th { background: #f6f8fc; color: var(--bd-muted); font-weight: 600; white-space: nowrap; }
.bd-table tbody th { font-weight: 600; white-space: nowrap; }
.bd-warning { margin: 2px 0 0 !important; color: #b06a00; font-size: 12px; }
.bd-rate { display: inline-block; padding: 1px 8px; border-radius: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bd-rate--high { background: #fdecea; color: #b3261e; }
.bd-rate--mid { background: #fff1dc; color: #a85b00; }
.bd-rate--low { background: #fff9e0; color: #7a6200; }
.bd-rate--none { background: #e7f5ee; color: #1c7a4c; }
.bd-rate--na { background: #eef1f6; color: var(--bd-muted); }
.bd-matrix th, .bd-matrix td { text-align: center; vertical-align: middle; }
.bd-matrix .bd-matrix-name { max-width: 320px; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.bd-matrix-self { color: #b6c0cf; }
.bd-matrix-cell { min-width: 84px; padding: 6px 10px; border: 1px solid transparent; border-radius: 6px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; }
.bd-matrix-cell:hover { border-color: var(--bd-blue); }

.bd-pair-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.bd-pair-tab { display: flex; flex-direction: column; align-items: flex-start; padding: 6px 14px; border: 1px solid #cbd5e3; border-radius: 8px; background: #fff; color: var(--bd-ink); cursor: pointer; }
.bd-pair-tab small { color: var(--bd-muted); font-size: 12px; }
.bd-pair-tab.is-active { border-color: var(--bd-blue); background: var(--bd-blue-soft); }
.bd-pair-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.bd-stat { min-width: 150px; padding: 10px 14px; border-radius: 8px; background: #f6f8fc; }
.bd-stat strong { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.bd-stat span { color: var(--bd-muted); font-size: 12px; }
.bd-view-tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--bd-line); }
.bd-view-tab { padding: 8px 18px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--bd-muted); cursor: pointer; }
.bd-view-tab.is-active { border-bottom-color: var(--bd-blue); color: var(--bd-blue); font-weight: 600; }

.bd-compare { display: grid; grid-template-columns: 280px minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.bd-compare h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-evidence ol, .bd-doc { height: 68vh; min-height: 420px; overflow-y: auto; border: 1px solid var(--bd-line); border-radius: 8px; }
.bd-evidence ol { margin: 0; padding: 0; list-style: none; }
.bd-evidence-item { display: block; width: 100%; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--bd-line); background: #fff; text-align: left; cursor: pointer; color: var(--bd-ink); }
.bd-evidence-item:hover { background: #f6f8fc; }
.bd-evidence-item.is-active { background: #fff4d9; box-shadow: inset 3px 0 0 var(--bd-active); }
.bd-evidence-meta { display: block; color: var(--bd-muted); font-size: 12px; }
.bd-evidence-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; }
.bd-doc { padding: 14px 16px; background: #fff; line-height: 1.85; }
.bd-doc p { margin: 0 0 8px; overflow-wrap: anywhere; }
.bd-doc .bd-cell { padding-left: 10px; border-left: 2px solid var(--bd-line); }
.bd-doc mark { background: var(--bd-hit); color: inherit; cursor: pointer; border-radius: 2px; }
.bd-doc mark.is-active { background: var(--bd-active); }
.bd-excluded { color: #9aa5b5; background: #f1f3f7; }
.bd-page { margin: 14px 0 8px; color: #9aa5b5; font-size: 12px; text-align: center; }
.bd-page::before, .bd-page::after { content: " — "; }
.bd-legend { display: flex; align-items: center; gap: 6px; margin-top: 10px !important; color: var(--bd-muted); font-size: 12px; }
.bd-swatch { display: inline-block; width: 14px; height: 14px; margin-left: 12px; border-radius: 3px; }
.bd-swatch:first-child { margin-left: 0; }
.bd-swatch--hit { background: var(--bd-hit); }
.bd-swatch--active { background: var(--bd-active); }
.bd-swatch--excluded { background: #e3e7ee; }

.bd-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.bd-image-pair { margin: 0; padding: 12px; border: 1px solid var(--bd-line); border-radius: 8px; }
.bd-image-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.bd-image-sides img { display: block; width: 100%; height: 160px; object-fit: contain; background: #f6f8fc; border-radius: 6px; }
.bd-image-sides figcaption { margin-top: 4px; color: var(--bd-muted); font-size: 12px; }

.bd-clues { margin: 0 0 14px; padding: 0; list-style: none; }
.bd-clue { display: flex; align-items: baseline; gap: 10px; padding: 8px 12px; margin-bottom: 6px; border-radius: 7px; background: #f6f8fc; }
.bd-clue--strong { background: #fff1dc; }
.bd-clue--strong .bd-tag { background: #ffd9a3; color: #8a4b00; }
.bd-same { font-weight: 600; }
.bd-same--1 { background: #fff1dc; }
.bd-same--2 { background: #e6f0ff; }
.bd-same--3 { background: #e7f5ee; }

@media (max-width: 960px) {
    .bd { padding: 16px 14px 40px; }
    .bd-features, .bd-uploads { grid-template-columns: 1fr; }
    .bd-dimensions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bd-compare { grid-template-columns: 1fr; }
    .bd-evidence ol { height: 220px; min-height: 0; }
    .bd-doc { height: 50vh; min-height: 300px; }
}
