/* BoQ Lint v2 · tokens per design/v2-visual-spec.md §2-§5. 只动 transform/opacity；禁用 transition-all */
:root {
  color-scheme: light;
  --bg: #F7F7F4; --surface: #FFFFFF; --surface-2: #F0F0EC;
  --border: #E4E4DF; --border-strong: #CFCFC8;
  --text: #111315; --text-2: #5A5F66; --text-3: #6E737A;
  --accent: #1F3A5F; --accent-bg: #E8EDF4; --focus-ring: #1F3A5F;
  --fail: #B42E27; --fail-bg: #FBEDEB; --warn: #8A5A00; --warn-bg: #FDF3E1;
  --pass: #1F6B43; --pass-bg: #E9F3EC; --skip: #5F646B; --skip-bg: #F0F0EC;
  --confirm: #8A5A00; --confirm-bg: #FDF3E1;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Noto Sans SC", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(17,19,21,.05), 0 4px 16px rgba(17,19,21,.04);
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --r-btn: 10px; --r-card: 14px; --r-compare: 16px; --r-badge: 6px;
  --pad-x: 20px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.55 var(--font); overflow-x: hidden; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.small { font-size: 13px; line-height: 1.4; color: var(--text-2); }
.label { font-size: 12px; font-weight: 600; line-height: 1; letter-spacing: .02em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--pad-x); }
.wrap-tool { max-width: 1200px; margin: 0 auto; padding: 0 var(--pad-x); }
[hidden] { display: none !important; }

/* TopBar */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar .wrap, .topbar .wrap-tool { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 17px; color: var(--text); text-decoration: none; min-height: 44px; }
.brand::before { content: ""; width: 6px; height: 6px; background: var(--text); }
.nav { display: flex; gap: 4px; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--text); text-decoration: none; font-size: 15px; border-bottom: 2px solid transparent; touch-action: manipulation; }
.nav a[aria-current="page"] { border-bottom-color: var(--accent); }

/* Buttons */
.btn { -webkit-appearance: none; appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: var(--r-btn); border: 1px solid transparent; font: 600 15px/1 var(--font);
  cursor: pointer; text-decoration: none; touch-action: manipulation; user-select: none;
  transition: transform 100ms var(--ease), opacity 150ms var(--ease); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn-primary { background: var(--text); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #2A2D31; }
.btn-primary:active:not(:disabled) { background: #000; }
.btn-apply { background: var(--accent); color: #fff; }
.btn-apply:hover:not(:disabled) { background: #18304F; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text); min-height: 44px; padding: 0 12px; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn:disabled { background: var(--surface-2); color: var(--text-3); cursor: not-allowed; border-color: transparent; }
.btn-ghost:disabled { background: transparent; }
.btn-block { width: 100%; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-inline { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; font-weight: 500;
  display: inline-flex; align-items: center; min-height: 44px; touch-action: manipulation; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--r-badge); font-size: 12px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.badge svg { width: 12px; height: 12px; }
.badge-fail { background: var(--fail-bg); color: var(--fail); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-pass { background: var(--pass-bg); color: var(--pass); }
.badge-skip { background: var(--skip-bg); color: var(--skip); }
.chip { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 10px; border-radius: 999px; background: var(--confirm-bg);
  color: var(--confirm); border: 1px dashed var(--confirm); font: 400 13px/1.3 var(--mono); white-space: nowrap; }
button.chip { cursor: pointer; min-height: 44px; background-clip: content-box; padding: 10px 0; border: 0; background: none; touch-action: manipulation; }
button.chip > span { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 10px; border-radius: 999px; background: var(--confirm-bg); border: 1px dashed var(--confirm); }
.chip.flash, .chip-inline.flash { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip-inline { display: inline; padding: 1px 6px; border-radius: 999px; background: var(--confirm-bg); color: var(--confirm); border: 1px dashed var(--confirm); white-space: nowrap; font-size: .92em; }
.chips { display: flex; flex-wrap: wrap; gap: 0 8px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 16px; }
.h-display { font-size: 32px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
.h2 { font-size: 22px; font-weight: 600; line-height: 1.2; margin: 0 0 16px; }
.h3 { font-size: 17px; font-weight: 600; line-height: 1.3; margin: 0; }
.body-l { font-size: 17px; line-height: 1.5; color: var(--text-2); margin: 0; }
.eyebrow { font-size: 13px; color: var(--text-2); margin: 0 0 12px; }

/* Landing */
.hero { padding-block: 24px 64px; display: grid; gap: 24px; }
.hero-text { display: grid; gap: 16px; align-content: start; }
.hero-cta { display: grid; gap: 4px; margin-top: 8px; }
.compare { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-compare); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 14px; }
.compare-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.compare-head .left { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.qty-lock { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.qty-lock svg { width: 12px; height: 12px; }
.desc-box { font: 400 15px/1.6 var(--mono); word-break: break-word; }
.issue { text-decoration: underline wavy var(--fail); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.issue-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.issue-tag { font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--fail); background: var(--fail-bg); border-radius: var(--r-badge); padding: 3px 8px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--text-3); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.divider svg { width: 16px; height: 16px; }
.added { background: var(--pass-bg); color: var(--pass); border-radius: 3px; padding: 0 1px; }
.after { display: grid; gap: 8px; }
.after-head { display: flex; align-items: center; gap: 8px; }
.reveal { opacity: 0; transform: translateY(8px); transition: transform 200ms var(--ease), opacity 200ms var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.swap { transition: opacity 160ms var(--ease); }
.swap.out { opacity: 0; }
.compare-foot { display: grid; gap: 8px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--r-btn); padding: 2px; }
.seg button { min-height: 44px; padding: 0 14px; border: 0; background: transparent; border-radius: 8px; font: 600 13px var(--font); color: var(--text-2); cursor: pointer; touch-action: manipulation; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); }
.section { padding-top: 64px; }
.caps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cap { border-top: 1px solid var(--border); padding-top: 12px; }
.cap b { display: block; font-size: 15px; margin-bottom: 4px; }
.cap span { font-size: 13px; color: var(--text-2); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; gap: 8px; align-items: baseline; }
.steps li::before { content: counter(s); font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-2); }
.steps b { font-weight: 600; margin-right: 6px; }
.tools { display: grid; gap: 16px; }
.tools .card { display: grid; gap: 10px; align-content: start; }
.trust { display: flex; flex-wrap: wrap; gap: 6px 10px; color: var(--text-2); font-size: 13px; padding-block: 48px 64px; }
.trust { display: grid; gap: 4px; }
.small-link { font-size: 13px; justify-self: start; }
.footer { background: var(--surface-2); padding: 24px 0 calc(24px + env(safe-area-inset-bottom)); }
.footer p { margin: 0 0 6px; font-size: 13px; color: var(--text-2); max-width: 640px; }
.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 12px var(--pad-x) calc(12px + env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--border); box-shadow: var(--shadow);
  transform: translateY(100%); opacity: 0; pointer-events: none; transition: transform 200ms var(--ease), opacity 200ms var(--ease); }
.sticky-cta.show { transform: none; opacity: 1; pointer-events: auto; }
.sticky-cta .row { display: flex; gap: 8px; }
.sticky-cta .row .btn { flex: 1; }

/* Tool pages */
.tool-head { padding: 16px 0 16px; display: grid; gap: 4px; }
.field-label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .02em; margin-bottom: 8px; }
textarea, select, input[type="text"] { font-size: 16px; }
.textarea { width: 100%; min-height: 96px; max-height: 240px; resize: vertical; background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-btn); padding: 14px; font: 400 16px/1.6 var(--mono); }
.textarea:focus { border-color: var(--accent); outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.select, .input { width: 100%; min-height: 48px; border: 1px solid var(--border-strong); border-radius: var(--r-btn); background: var(--surface); color: var(--text); padding: 0 12px; font: 400 16px var(--font); }
.select { -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%235A5F66' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
details.more { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
details.more summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; touch-action: manipulation; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "+"; margin-left: auto; color: var(--text-2); }
details.more[open] summary::after { content: "−"; }
.more-body { display: grid; gap: 12px; padding: 4px 0 16px; }
.stack { display: grid; gap: 16px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: var(--r-btn); background: var(--warn-bg); color: var(--text); font-size: 13px; line-height: 1.5; }
.notice .badge { flex: none; }
.notice a { min-height: 0; }
.fix-grid { display: grid; gap: 24px; padding-bottom: 96px; }
.draft-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-compare); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 14px; }
.draft-card .draft { font: 400 17px/1.6 var(--mono); word-break: break-word; }
.draft-card.dim { opacity: .5; transition: opacity 150ms var(--ease); }
.draft-card.stale { opacity: .6; }
.empty { color: var(--text-3); font-size: 15px; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; }
.examples .btn { font: 400 13px var(--mono); min-height: 44px; }
.findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.findings li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.findings li .msg { font-size: 13px; color: var(--text-2); display: block; }
.removed { font-size: 13px; color: var(--text-2); }
.removed s { font-family: var(--mono); }
.qty-note { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.qty-note svg { width: 12px; height: 12px; }
.error-card { border-color: var(--fail); background: var(--fail-bg); }

/* Lint */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button { min-height: 44px; padding: 0 14px; border: 0; background: none; border-bottom: 2px solid transparent; font: 600 15px var(--font); color: var(--text-2); cursor: pointer; touch-action: manipulation; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.dropzone { display: grid; place-items: center; gap: 10px; text-align: center; min-height: 128px; padding: 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--r-card); background: var(--surface); cursor: pointer; }
.dropzone.drag { border-style: solid; border-color: var(--accent); background: var(--accent-bg); }
.dropzone svg { width: 24px; height: 24px; color: var(--text-2); }
.file-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-btn); background: var(--surface); }
.file-row .name { font-family: var(--mono); font-size: 14px; word-break: break-all; }
.colcheck { display: grid; gap: 6px; font-size: 14px; transition: opacity 150ms var(--ease); }
.colcheck .line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.run-note { font-size: 13px; color: var(--fail); }
.summary { display: flex; gap: 8px; overflow-x: auto; padding: 2px; -webkit-overflow-scrolling: touch; }
.count-btn { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: var(--r-btn); border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: 600 14px var(--font); color: var(--text); touch-action: manipulation; transition: transform 100ms var(--ease); }
.count-btn:active { transform: scale(0.97); }
.count-btn[aria-pressed="true"] { background: var(--accent-bg); border-color: var(--accent); }
.count-btn .n { font-size: 20px; font-variant-numeric: tabular-nums; }
.count-btn .ic { width: 12px; height: 12px; }
.count-btn.fail .ic { color: var(--fail); } .count-btn.warn .ic { color: var(--warn); } .count-btn.pass .ic { color: var(--pass); } .count-btn.skip .ic { color: var(--skip); }
.meta { font-size: 13px; color: var(--text-2); }
.lint-layout { display: grid; gap: 24px; padding-bottom: 112px; }
.side { display: grid; gap: 16px; align-content: start; }
.results { display: grid; gap: 12px; }
.rcard { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 16px 16px 16px 19px; display: grid; gap: 6px; overflow: hidden; transition: opacity 150ms var(--ease); }
.rcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--skip); }
.rcard.fail::before { background: var(--fail); } .rcard.warn::before { background: var(--warn); } .rcard.pass::before { background: var(--pass); }
.rcard .top { display: flex; align-items: center; gap: 8px; }
.rcard .top .id { margin-left: auto; font-family: var(--mono); font-size: 13px; }
.rcard .issue-l { font-size: 15px; font-weight: 600; }
.rcard .msgs { font-size: 13px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rcard.open .msgs { -webkit-line-clamp: unset; display: block; }
.rcard .foot { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; color: var(--text-2); }
.rcard .toggle { justify-self: start; }
.detail { display: grid; gap: 8px; }
.ro { background: var(--surface-2); border-radius: var(--r-btn); padding: 10px 12px; font: 400 14px/1.6 var(--mono); word-break: break-word; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; font-size: 13px; }
.kv dt { color: var(--text-2); } .kv dd { margin: 0; font-variant-numeric: tabular-nums; }
.table-wrap { display: none; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); }
table.res { width: 100%; border-collapse: collapse; font-size: 14px; }
table.res th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .02em; padding: 10px 12px; white-space: nowrap; }
table.res td { padding: 12px; border-top: 1px solid var(--border); vertical-align: top; }
table.res tr.r { cursor: pointer; }
table.res tr.r:hover td { background: var(--bg); }
table.res tr.r[aria-selected="true"] td { background: var(--accent-bg); }
table.res td.qty, table.res th.qty { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.res td .msgs { color: var(--text-2); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 360px; }
.drawer { display: none; }
.collapse-note { display: flex; justify-content: center; }
.confirm-sum { display: grid; gap: 4px; }
.confirm-sum button { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; border: 0; background: none; cursor: pointer; padding: 0; font: 400 13px var(--font); color: var(--text-2); touch-action: manipulation; }
.confirm-sum button[aria-pressed="true"] .chip { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (min-width: 768px) {
  :root { --pad-x: 32px; }
  .caps { grid-template-columns: repeat(2, 1fr); }
  .rcard .detail .kv { grid-template-columns: 140px 1fr; }
  .hero-cta { grid-template-columns: auto auto; justify-content: start; align-items: center; gap: 16px; }
  .sticky-cta { display: none; }
  .trust { display: flex; }
  .trust span + span::before { content: "·"; margin-right: 10px; }
}
@media (min-width: 1024px) {
  body { font-size: 16px; }
  .topbar .wrap, .topbar .wrap-tool { height: 64px; }
  .h-display { font-size: 56px; }
  .h2 { font-size: 32px; } .h3 { font-size: 20px; }
  .body-l { font-size: 18px; }
  .btn { min-height: 44px; }
  .hero { grid-template-columns: 5fr 7fr; gap: 48px; align-items: center; padding-block: 64px 96px; }
  .compare { padding: 28px; }
  .section { padding-top: 96px; }
  .caps { grid-template-columns: repeat(4, 1fr); gap: 24px; }
  .tools { grid-template-columns: 1fr 1fr; }
  .card { padding: 24px; }
  .count-btn .n { font-size: 24px; }
  .fix-grid { grid-template-columns: 42fr 58fr; gap: 32px; align-items: start; padding-bottom: 64px; }
  .draft-card { padding: 28px; }
  .lint-layout { grid-template-columns: 320px 1fr; gap: 32px; align-items: start; padding-bottom: 64px; }
  .side { position: sticky; top: 80px; }
  .summary { flex-wrap: wrap; overflow: visible; }
  .results { display: none; }
  .table-wrap { display: block; max-height: 70vh; overflow: auto; }
  .drawer { display: block; position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 100vw; z-index: 40; background: var(--surface);
    border-left: 1px solid var(--border); box-shadow: var(--shadow); padding: 24px; overflow-y: auto;
    transform: translateX(100%); opacity: 0; pointer-events: none; transition: transform 200ms var(--ease), opacity 200ms var(--ease); }
  .drawer.open { transform: none; opacity: 1; pointer-events: auto; }
  .drawer .stack { gap: 14px; }
  .lint-sticky { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .btn, .count-btn, .reveal, .swap, .sticky-cta, .drawer, .rcard, .colcheck, .draft-card.dim { transition: opacity 100ms linear !important; }
  .btn:active:not(:disabled), .count-btn:active { transform: none; }
  .reveal { transform: none; }
  .sticky-cta, .drawer { transform: none !important; }
  .sticky-cta:not(.show) { opacity: 0; }
  .drawer:not(.open) { visibility: hidden; }
  .spinner { display: none; }
}
/* table column tuning (desktop) */
table.res td.mono, table.res td:first-child { white-space: nowrap; }
table.res td.issue-c { min-width: 120px; font-weight: 600; font-size: 13px; }
table.res td .msgs { min-width: 160px; }
table.res td.conf .chip { margin: 0 4px 4px 0; font-size: 12px; }
table.res td.conf { white-space: nowrap; }
.lint-layout > * , .fix-grid > * { min-width: 0; }
table.res td, table.res th { padding-left: 9px; padding-right: 9px; }
.lockic { display: inline-flex; } .lockic svg, .qty-note svg { width: 12px; height: 12px; }
.nowrap { white-space: nowrap; }
