/* 筛选组件的基础外观、布局与状态统一在本文件维护。 */
.tool-page .filter-state-bar { position: sticky; top: 8px; z-index: 20; padding: 14px; margin-bottom: 20px; }
.filter-state-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-state-label { color: var(--tool-muted); font-size: 13px; font-weight: 650; margin-right: 4px; }
.filter-state-chip { border: 1px solid #bfdbfe; background: var(--tool-accent-soft); border-radius: 999px; color: #1d4ed8; padding: 6px 10px; font-size: 12px; }
.filter-state-actions { display: flex; gap: 8px; margin-left: auto; }
.filter-state-btn { border: 1px solid var(--tool-line); border-radius: 9px; background: #fff; color: var(--tool-ink); cursor: pointer; padding: 8px 12px; font: inherit; font-size: 13px; }
.filter-state-btn.primary { color: #fff; border-color: var(--tool-accent); background: var(--tool-accent); }
.filter-state-btn:hover { border-color: #93c5fd; }
.filter-state-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.filter-picker { position: relative; }
.filter-picker > summary, .filter-picker-trigger { display: flex; justify-content: space-between; align-items: center; width: 100%; box-sizing: border-box; border: 1px solid var(--tool-line); background: var(--tool-soft); color: var(--tool-ink); border-radius: 10px; padding: 10px 12px; cursor: pointer; list-style: none; }
.filter-picker > summary::-webkit-details-marker { display: none; }
.filter-picker[open] > summary { border-color: #93c5fd; background: #fff; }
.filter-picker-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); min-width: 250px; max-height: min(420px, 60vh); overflow: auto; padding: 10px; background: #fff; border: 1px solid var(--tool-line); border-radius: 12px; box-shadow: 0 16px 40px rgba(15, 23, 42, .15); }
.filter-picker-menu label { display: flex; gap: 8px; padding: 7px 5px; align-items: flex-start; font-size: 13px; line-height: 1.35; }
.filter-picker-menu label:hover { background: var(--tool-soft); }
.filter-picker-menu input[type="search"] { width: 100%; box-sizing: border-box; border: 1px solid var(--tool-line); border-radius: 8px; padding: 8px; margin-bottom: 7px; }
.filter-picker-tools { display: flex; gap: 6px; padding: 4px 0 8px; border-bottom: 1px solid var(--tool-line); margin-bottom: 5px; }
.filter-picker-tools button { border: 0; background: transparent; color: var(--tool-accent); cursor: pointer; padding: 4px 5px; font-size: 12px; }
.filter-more { margin-top: 10px; border-top: 1px solid var(--tool-line); padding-top: 10px; }
.filter-more > summary { cursor: pointer; color: var(--tool-muted); font-size: 13px; }
.filter-more-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding-top: 10px; }
.filter-inline { display: flex; align-items: center; gap: 7px; min-height: 38px; color: var(--tool-muted); font-size: 12px; }
.filter-inline select, .filter-inline input { width: 100%; min-width: 0; border: 1px solid var(--tool-line); border-radius: 8px; padding: 8px; background: #fff; color: var(--tool-ink); }
.filter-help { color: var(--tool-muted); font-size: 12px; line-height: 1.5; margin: 10px 2px 0; }

@media (max-width: 800px) {
  .tool-page .filter-state-bar { top: 4px; }
  .filter-state-actions { width: 100%; margin-left: 0; }
  .filter-state-actions button { flex: 1; }
  .filter-state-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-picker-menu { position: fixed; left: 12px; right: 12px; top: 92px; max-height: 65vh; }
}
@media (max-width: 460px) {
  .filter-state-grid, .filter-more-grid { grid-template-columns: 1fr; }
  .filter-state-summary { align-items: flex-start; }
  .filter-state-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

:is(.homepage-unified-active, .tool-unified-active) #platformTagBar,
:is(.homepage-unified-active, .tool-unified-active) #plansTableSection > .filter-bar {
  display: none;
}

.main-view-full-link {
  color: #3157c8;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.main-view-full-link:hover,
.main-view-full-link:focus-visible {
  text-decoration: underline;
}

:is(.homepage-unified-active, .tool-unified-active) .main-view-shell > .filter-state-bar {
  margin-bottom: 12px;
}

:is(.homepage-unified-active, .tool-unified-active) .usage-view > .usage-filters,
:is(.homepage-unified-active, .tool-unified-active) #view-monitor .monitor-control,
:is(.homepage-unified-active, .tool-unified-active) #view-monitor #monitorClearFilters {
  display: none;
}

:is(.homepage-unified-active, .tool-unified-active) .filter-state-bar {
  background: rgba(255, 255, 255, .96);
  padding: 14px;
  margin-bottom: 12px;
  position: relative;
  z-index: 20;
}

:is(.homepage-unified-active, .tool-unified-active) .filter-picker[open] { z-index: 31; }
:is(.homepage-unified-active, .tool-unified-active) .filter-inline input[type="checkbox"] { width: auto; }

:is(.homepage-unified-active, .tool-unified-active) .filter-state-hint {
  margin: 9px 2px 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

:is(.homepage-unified-active, .tool-unified-active) .filter-subgroup {
  grid-column: span 2;
  border: 1px solid var(--tool-line, #e2e8f0);
  border-radius: 10px;
  padding: 9px;
  color: #64748b;
  font-size: 12px;
}

:is(.homepage-unified-active, .tool-unified-active) .filter-subgroup strong {
  display: block;
  margin-bottom: 6px;
  color: #334155;
}

:is(.homepage-unified-active, .tool-unified-active) .filter-subgroup label,
:is(.homepage-unified-active, .tool-unified-active) .filter-range {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 5px 0;
}

:is(.homepage-unified-active, .tool-unified-active) .filter-subgroup label {
  display: inline-flex;
  margin-right: 10px;
}

:is(.homepage-unified-active, .tool-unified-active) .filter-range span:first-child {
  min-width: 105px;
}

:is(.homepage-unified-active, .tool-unified-active) .filter-range input {
  width: 82px;
  box-sizing: border-box;
  border: 1px solid var(--tool-line, #e2e8f0);
  border-radius: 7px;
  padding: 5px 6px;
}

@media (max-width: 800px) {
  :is(.homepage-unified-active, .tool-unified-active) .filter-subgroup { grid-column: span 1; }
}

.filter-picker-menu label[hidden] { display: none; }

/* Match the original Tab filter bar: compact controls and restrained borders. */
:is(.homepage-unified-active, .tool-unified-active) .filter-state-bar {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow-sm);
  overflow: visible;
}
:is(.homepage-unified-active, .tool-unified-active) .filter-state-summary { display: none; }
:is(.homepage-unified-active, .tool-unified-active) .filter-state-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
}
:is(.homepage-unified-active, .tool-unified-active) .filter-picker { flex: 0 0 auto; }
:is(.homepage-unified-active, .tool-unified-active) .filter-picker > summary {
  width: auto;
  min-height: 38px;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 9px;
  border-color: var(--border-color);
  background: #fff;
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
}
:is(.homepage-unified-active, .tool-unified-active) .filter-picker > summary::after {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
:is(.homepage-unified-active, .tool-unified-active) .filter-picker[open] > summary,
:is(.homepage-unified-active, .tool-unified-active) .filter-picker > summary:hover {
  border-color: rgba(11, 104, 209, .35);
  color: var(--accent-primary);
  background: #f3f8ff;
}
:is(.homepage-unified-active, .tool-unified-active) .filter-picker-count {
  padding: 1px 6px;
  border-radius: 5px;
  background: #edf3fb;
  color: var(--accent-primary);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
:is(.homepage-unified-active, .tool-unified-active) .filter-state-actions { width: auto; margin-left: auto; gap: 8px; }
:is(.homepage-unified-active, .tool-unified-active) .filter-state-actions .filter-state-btn {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 9px;
  border-color: var(--border-color);
  color: var(--text-secondary);
  background: #fff;
  font-weight: 500;
}
:is(.homepage-unified-active, .tool-unified-active) .filter-state-actions .primary { color: var(--accent-primary); border-color: #b9d2ef; background: #f3f8ff; }
:is(.homepage-unified-active, .tool-unified-active) .filter-picker-menu {
  width: 320px;
  right: auto;
  max-height: min(420px, 60vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-color: var(--border-color);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(16, 23, 37, .14);
}
:is(.homepage-unified-active, .tool-unified-active) .filter-picker-menu > * { flex-shrink: 0; }
:is(.homepage-unified-active, .tool-unified-active) [data-picker-options] { overflow-y: auto; min-height: 0; flex: 1 1 auto; overscroll-behavior: contain; }
:is(.homepage-unified-active, .tool-unified-active) .filter-picker-menu label { align-items: center; gap: 10px; padding: 8px; border-radius: 6px; color: var(--text-secondary); }
:is(.homepage-unified-active, .tool-unified-active) .filter-picker-menu input[type="checkbox"] { accent-color: #374151; width: 14px; height: 14px; }
:is(.homepage-unified-active, .tool-unified-active) .filter-more { border: 0; margin-top: 8px; padding-top: 0; }
:is(.homepage-unified-active, .tool-unified-active) .filter-more > summary { width: fit-content; font-size: 12px; color: var(--text-tertiary); padding: 3px 0; }
:is(.homepage-unified-active, .tool-unified-active) .filter-more[open] { border-top: 1px solid var(--border-light); padding-top: 8px; }
:is(.homepage-unified-active, .tool-unified-active) .filter-picker > summary:focus-visible,
:is(.homepage-unified-active, .tool-unified-active) .filter-state-btn:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
@media (max-width: 800px) {
  :is(.homepage-unified-active, .tool-unified-active) .filter-picker { flex: 1 1 calc(50% - 10px); min-width: 0; }
  :is(.homepage-unified-active, .tool-unified-active) .filter-picker > summary { width: 100%; }
  :is(.homepage-unified-active, .tool-unified-active) .filter-picker-menu { width: auto; left: 12px; right: 12px; }
  :is(.homepage-unified-active, .tool-unified-active) .filter-state-actions { margin-left: 0; width: 100%; }
}

:is(.homepage-unified-active, .tool-unified-active) .filter-picker-menu { font-family: inherit; font-size: 13px; line-height: 1.5; }
:is(.homepage-unified-active, .tool-unified-active) .budget-menu { width: 350px; padding: 16px; gap: 12px; overflow-y: auto; }
.budget-heading { display: flex; align-items: center; justify-content: space-between; color: var(--text-primary); font-size: 14px; font-weight: 600; }
.budget-heading span { font-size: 12px; color: var(--text-tertiary); font-weight: 400; }
:is(.homepage-unified-active, .tool-unified-active) .budget-values { display: flex; align-items: center; gap: 12px; }
:is(.homepage-unified-active, .tool-unified-active) .budget-values label { display: block; flex: 1; min-width: 0; padding: 0; font-size: 12px; color: var(--text-secondary); }
:is(.homepage-unified-active, .tool-unified-active) .budget-values label:hover { background: transparent; }
.budget-values label > div { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border-color); border-radius: 8px; padding: 8px 10px; margin-top: 5px; background: #fff; }
.budget-values label > div:focus-within { border-color: var(--accent-primary); box-shadow: 0 0 0 2px rgba(11,104,209,.08); }
.budget-values input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--text-primary); font: inherit; font-size: 15px; font-variant-numeric: tabular-nums; background: transparent; }
.budget-values input::-webkit-inner-spin-button { -webkit-appearance: none; }
.budget-dash { margin-top: 20px; color: var(--text-tertiary); }
.budget-slider { height: 24px; position: relative; margin: 4px 9px 0; }
.budget-track, .budget-selected { position: absolute; left: 0; right: 0; height: 4px; top: 10px; border-radius: 4px; background: #e5ebf3; }
.budget-selected { right: auto; background: var(--accent-primary); }
.budget-slider input { position: absolute; inset: 0; width: 100%; height: 24px; margin: 0; appearance: none; -webkit-appearance: none; pointer-events: none; background: transparent; }
.budget-slider input::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--accent-primary); background: #fff; pointer-events: auto; cursor: grab; box-shadow: 0 2px 5px #17203322; }
.budget-slider input::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--accent-primary); background: #fff; pointer-events: auto; cursor: grab; }
.budget-slider input:focus-visible { outline: 2px solid #93c5fd; outline-offset: 4px; border-radius: 6px; }
.budget-scale { display: flex; justify-content: space-between; margin-top: -10px; font-size: 11px; color: var(--text-tertiary); }
:is(.homepage-unified-active, .tool-unified-active) .budget-menu .filter-help { margin: 0; font-size: 12px; line-height: 1.6; color: var(--text-tertiary); }
:is(.homepage-unified-active, .tool-unified-active) .budget-footer { margin: 0; padding: 10px 0 0; border-bottom: 0; border-top: 1px solid var(--border-light); justify-content: space-between; }
@media (max-width: 800px) { :is(.homepage-unified-active, .tool-unified-active) .budget-menu { width: auto; } }

.tool-unified-active [hidden] { display: none !important; }
.tool-unified-active .filter-state-bar { position: relative; top: auto; }
.tool-unified-active .filter-more-grid { padding-bottom: 6px; }

/* Display controls belong to the chart, even when filtering is shared. */
:is(.homepage-unified-active, .tool-unified-active) .usage-view > .usage-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 10px 14px; border-radius: 10px; background: #fff; border: 1px solid var(--border-color); }
:is(.homepage-unified-active, .tool-unified-active) .usage-filters > .filter-dropdown,
:is(.homepage-unified-active, .tool-unified-active) .usage-filters > .usage-inline-filter,
:is(.homepage-unified-active, .tool-unified-active) .usage-filters [data-action="restore-defaults"] { display: none; }

.monthly-token-cell { min-width: 145px; font-variant-numeric: tabular-nums; }


/* 首页和完整工具共享字段尺寸、标签层级与键盘反馈。 */
:is(.homepage-unified-active, .tool-unified-active) .filter-state-bar { padding: 20px 22px 16px; backdrop-filter: none; }
:is(.homepage-unified-active, .tool-unified-active) .filter-state-grid { gap: 8px; }
:is(.homepage-unified-active, .tool-unified-active) .filter-picker > summary {
  min-height: 40px; padding: 8px 12px; border-radius: 7px; background: #fff; gap: 12px;
  font-size: 13px; transition: border-color .15s, background .15s;
}
:is(.homepage-unified-active, .tool-unified-active) .filter-picker > summary:hover { border-color: #a5b9d1; background: #fafcff; }
:is(.homepage-unified-active, .tool-unified-active) .filter-picker[open] > summary { border-color: var(--accent-primary); background: var(--accent-soft); }
:is(.homepage-unified-active, .tool-unified-active) .filter-picker-menu { padding: 12px; border-radius: 10px; box-shadow: 0 12px 32px rgb(18 41 73 / 14%); }
:is(.homepage-unified-active, .tool-unified-active) .filter-picker-menu input[type="search"] { min-height: 40px; background: #f8fafc; font: inherit; }
body .filter-picker-menu label[data-filter-option]:has(input:checked) { background: #f3f4f6; color: #111827; font-weight: 600; }
body .filter-picker-menu label[data-filter-option]:has(input:checked):hover { background: #e5e7eb; }
:is(.homepage-unified-active, .tool-unified-active) .filter-picker-menu label:hover { background: #f3f4f6; }
:is(.homepage-unified-active, .tool-unified-active) .filter-picker-menu label { min-height: 36px; }
:is(.homepage-unified-active, .tool-unified-active) .guide-filter-fields {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px;
  padding: 18px 0 12px; margin: 0; width: 100%;
}
:is(.homepage-unified-active, .tool-unified-active) .filter-choice {
  display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 0;
  color: var(--text-secondary); font-size: 12px;
}
:is(.homepage-unified-active, .tool-unified-active) .filter-choice > span { width: auto; white-space: nowrap; }
:is(.homepage-unified-active, .tool-unified-active) .filter-choice select {
  width: 100%; min-width: 0; max-width: none; min-height: 38px; padding: 6px 9px;
  border: 1px solid var(--border-color); border-radius: 6px; background: #fff;
  color: var(--text-primary); font: inherit; font-size: 13px; cursor: pointer;
}
:is(.homepage-unified-active, .tool-unified-active) .filter-choice select:hover { border-color: #a5b9d1; }
.filter-checks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 22px; border-top: 1px solid var(--border-light); padding-top: 12px; }
.filter-checks:empty { display: none; }
body #homeStatusPicker { min-width: 0; }
body #homeStatusPicker > summary { display: flex; width: 100%; min-height: 40px; font-weight: 400; color: var(--text-primary); }
body #homeStatusPicker > summary::after { flex-shrink: 0; margin-left: auto; }
body #homeStatusPicker [data-status-label] { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
body #homeStatusPicker .filter-picker-menu { width: 240px; padding: 8px; gap: 2px; }
body #homeStatusPicker .filter-picker-tools { grid-template-columns: minmax(0, 1fr); margin: 0 0 4px; }
body #homeStatusPicker .filter-picker-menu label { display: flex; min-height: 40px; color: var(--text-primary); font-weight: 400; cursor: pointer; }
body #homeStatusPicker .filter-picker-menu label:has(input:checked) { background: #f3f4f6; }
body #homeStatusPicker .status-picker-history { display: grid; gap: 2px; border-top: 1px solid var(--border-color); margin-top: 6px; padding-top: 6px; }
body #homeStatusPicker .filter-picker-menu label:hover, body #homeStatusPicker .filter-picker-menu label:focus-within { background: #e5e7eb; }
body #homeStatusPicker input:focus-visible { outline: 2px solid #6b7280; outline-offset: 3px; }
@media (max-width: 800px) {
  body #homeStatusPicker > summary, body #homeStatusPicker .filter-picker-menu label { min-height: 44px; }
  body #homeStatusPicker .filter-picker-menu { width: auto; }
}
.filter-checks .filter-inline { font-size: 12px; cursor: pointer; min-height: 30px; }
.filter-checks input[type="checkbox"] { width: 15px; height: 15px; margin: 0; }
.filter-state-actions { display: flex !important; gap: 8px; flex-wrap: wrap; }
.filter-state-actions button { font: inherit; font-size: 12px; border: 1px solid var(--border-color); border-radius: 6px; background: #fff; padding: 6px 10px; color: var(--text-secondary); cursor: pointer; }
.filter-state-actions button:hover { color: var(--accent-primary); border-color: #a5b9d1; }
.filter-state-grid > .filter-picker { min-width: 130px; }
.budget-menu .filter-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
body .filter-picker-menu .range-picker-value { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
body .filter-picker-menu .range-picker-value label,
body .filter-picker-menu .range-picker-value label:hover { padding: 0; gap: 10px; min-width: 0; flex-wrap: nowrap; background: transparent; white-space: nowrap; }
body .filter-picker-menu .range-picker-number { display: flex; align-items: center; gap: 8px; width: 144px; min-width: 0; min-height: 40px; padding: 0 12px; border: 1px solid #d1d5db; border-radius: 8px; background: #f9fafb; transition: background .15s, border-color .15s, box-shadow .15s; }
body #homeTokenPicker .range-picker-value label { flex: 0 1 auto; }
body #homeTokenPicker .range-picker-number { flex: 0 1 200px; width: 200px; }
body .filter-picker-menu .range-picker-number:hover { border-color: #9ca3af; background: #fff; }
body .filter-picker-menu .range-picker-number:focus-within { border-color: #9ca3af; background: #fff; box-shadow: 0 0 0 2px rgb(156 163 175 / 8%); }
body .filter-picker-menu .range-picker-number input { appearance: textfield; -moz-appearance: textfield; flex: 1; width: 100%; min-width: 0; min-height: 0; height: 36px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: #111827; font: inherit; font-size: 15px; font-weight: 500; line-height: 1.5; font-variant-numeric: tabular-nums; }
body .filter-picker-menu .range-picker-number input::placeholder { color: #9ca3af; font-weight: 400; opacity: 1; }
body #homeTokenPicker .range-picker-number input { flex: 0 1 auto; width: calc(var(--token-digits, 4) * 1ch); max-width: calc(100% - 24px); }
body .filter-picker-menu .range-picker-number input::-webkit-inner-spin-button, body .filter-picker-menu .range-picker-number input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
body .filter-picker-menu .range-picker-number input:focus-visible { outline: none; box-shadow: none; }
body .filter-picker-menu .range-picker-unit { flex-shrink: 0; color: #6b7280; font-size: 13px; font-weight: 400; }
body .filter-picker-menu.budget-menu { gap: 8px; padding: 14px; }
body .range-picker-slider { margin: 0 24px; }
body .range-picker-slider input[type="range"] { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 24px; margin: 0; padding: 0; border: 0; border-radius: 6px; background: transparent; cursor: pointer; }
body .range-picker-slider input::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, #4b5563 var(--range-fill, 0%), #e5e7eb var(--range-fill, 0%)); }
body .range-picker-slider input::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border: 2px solid #4b5563; border-radius: 50%; background: #fff; }
body .range-picker-slider input::-moz-range-track { height: 4px; border-radius: 4px; background: #e5e7eb; }
body .range-picker-slider input::-moz-range-progress { height: 4px; border-radius: 4px; background: #4b5563; }
body .range-picker-slider input::-moz-range-thumb { width: 14px; height: 14px; border: 2px solid #4b5563; border-radius: 50%; background: #fff; }
body .range-picker-slider .range-picker-ticks { position: relative; height: 32px; margin: 0 9px; }
body .range-picker-ticks button { position: absolute; left: var(--tick-position); transform: translateX(-50%); display: inline-flex; align-items: center; justify-content: center; min-width: 28px; min-height: 32px; padding: 0; border: 0; background: transparent; color: #4b5563; font: inherit; font-size: 12px; font-weight: 500; line-height: 1.5; white-space: nowrap; cursor: pointer; }
body .range-picker-ticks button > span { padding: 4px; border-radius: 6px; transition: background .15s, color .15s; }
body .range-picker-ticks button::before { content: ""; position: absolute; top: 0; left: 50%; width: 1px; height: 4px; background: #d1d5db; }
body .range-picker-ticks button:hover > span, body .range-picker-ticks button[aria-pressed="true"] > span { color: #111827; background: #f3f4f6; }
body .range-picker-ticks button:focus-visible { outline: none; }
body .range-picker-ticks button:focus-visible > span { outline: 2px solid #6b7280; outline-offset: 1px; }
body .filter-picker-menu.budget-menu .filter-help { margin: 0; color: #6b7280; font-size: 12px; line-height: 1.6; }
body .range-picker-title { flex-shrink: 0; white-space: nowrap; }
body [data-budget-label], body [data-token-label] { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
body .range-picker-slider input:focus-visible { outline: 2px solid #6b7280; outline-offset: 2px; }
@media (max-width: 800px) {
  body .filter-picker-menu .range-picker-number { width: 138px; min-height: 44px; }
  body .range-picker-slider input[type="range"] { height: 44px; }
  body .range-picker-ticks button { min-height: 44px; }
  body .range-picker-slider .range-picker-ticks { height: 44px; }
}
body.tool-unified-active .filter-state-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border-color); }
body.tool-unified-active .filter-state-footer .filter-checks { border: 0; padding: 0; }
body.tool-unified-active .filter-state-footer .filter-state-actions { flex: 0 0 auto; width: auto; max-width: 100%; justify-content: flex-end; margin: 0 0 0 auto; }
body.tool-unified-active .filter-state-actions > button { flex: none; white-space: nowrap; }
.tool-unified-active .filter-state-hint { margin-top: 8px; min-height: 32px; display: flex; align-items: center; }
@media (max-width: 1100px) {
  :is(.homepage-unified-active, .tool-unified-active) .guide-filter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  :is(.homepage-unified-active, .tool-unified-active) .filter-state-bar { padding: 16px; }
  :is(.homepage-unified-active, .tool-unified-active) .guide-filter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 16px; }
  .filter-state-grid { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-state-grid > .filter-picker { min-width: 0; }
  .filter-checks { gap: 6px 14px; }
  .filter-checks .filter-inline { font-size: 12px; }
  :is(.homepage-unified-active, .tool-unified-active) .filter-picker > summary { padding: 8px 9px; gap: 6px; }
}

.filter-search-empty { color: var(--text-secondary); padding: 22px 8px; text-align: center; font-size: 13px; line-height: 1.7; }
.filter-search-empty[hidden] { display: none; }
body .filter-state-actions > button[data-filter-action] {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f3f4f6;
  color: #374151;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
body .filter-state-actions > button[data-filter-action]:hover:not(:disabled) {
  background: #e5e7eb;
  border-color: #9ca3af;
  color: #111827;
}
body .filter-state-actions > button[data-filter-action]:active:not(:disabled) { background: #d1d5db; }
body .filter-state-actions > button[data-filter-action]:disabled { background: #f3f4f6; border-color: #d1d5db; color: #374151; opacity: .5; cursor: not-allowed; }
body .filter-state-actions > button[data-filter-action]:focus-visible { outline: 2px solid #6b7280; outline-offset: 2px; }
@media (max-width: 800px) {
  body .filter-state-actions > button[data-filter-action] { min-height: 44px; }
}
body .filter-picker-menu .filter-picker-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: fit-content;
  max-width: 100%;
  gap: 8px;
  padding: 0;
  margin: 2px 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
body .filter-picker-menu .filter-picker-tools button {
  min-width: 0;
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #f3f4f6;
  color: #374151;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
body .filter-picker-menu .filter-picker-tools button:hover {
  background: #fff;
  border-color: #9ca3af;
  color: #111827;
}
body .filter-picker-menu .filter-picker-tools button:active { background: #e5e7eb; }
body .filter-picker-menu .filter-picker-tools button:focus-visible { outline: 2px solid #6b7280; outline-offset: 1px; }
@media (max-width: 800px) {
  :is(.homepage-unified-active, .tool-unified-active) .filter-picker-menu { top: auto; bottom: 18px; max-height: min(520px, 70dvh); border-color: #bccde1; }
  body .filter-picker-menu .filter-picker-tools button { min-height: 44px; }
}

@media (min-width: 1101px) {
  .homepage-unified-active .guide-filter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-unified-active .guide-filter-fields { grid-template-columns: minmax(0, 1fr); }
}

/* Shared pickers sit above page content and the directory, below the site header. */
body:is(.homepage-unified-active, .tool-unified-active) .filter-state-bar:has(.filter-picker[open]) { z-index: 35; }

/* Model picks, preset shortcuts and the optional strict requirement share one panel. */
body :is(#homePlatformPicker, #homeModelPicker) .filter-picker-menu { width: 380px; max-height: min(620px, 75dvh); overflow-y: auto; }
body :is(#homePlatformPicker, #homeModelPicker) [data-picker-options] { flex: 1 1 auto; min-height: 100px; max-height: 260px; padding-top: 6px; border-top: 1px solid var(--border-light); }
body :is(#homePlatformPicker, #homeModelPicker) .filter-picker-tools { display: flex; gap: 8px; padding: 0; border-bottom: 0; margin: 2px 0 12px; }
body :is(#homePlatformPicker, #homeModelPicker) .filter-picker-tools { align-items: center; flex-wrap: wrap; width: 100%; }
body .picker-selection-count { margin-left: auto; color: var(--text-secondary); font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; white-space: nowrap; }
body .picker-selection-count strong { color: var(--text-primary); font-size: inherit; font-weight: 600; }
body .picker-count-divider { padding: 0 2px; color: var(--text-muted); }
body :is(#homePlatformPicker, #homeModelPicker) .filter-picker-tools button { min-height: 32px; padding: 4px 14px; border-color: var(--border-color); background: var(--bg-tertiary); color: var(--text-secondary); font-size: 13px; font-weight: 500; }
body :is(#homePlatformPicker, #homeModelPicker) .filter-picker-tools button:hover { background: var(--bg-secondary); border-color: var(--border-strong); color: var(--text-primary); }
body :is(#homePlatformPicker, #homeModelPicker) .filter-picker-tools button:active { background: var(--bg-tertiary); }
body :is(#homePlatformPicker, #homeModelPicker) [data-picker-options] { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; padding-right: 4px; }
body :is(#homePlatformPicker, #homeModelPicker) [data-picker-options]::-webkit-scrollbar { width: 6px; }
body :is(#homePlatformPicker, #homeModelPicker) [data-picker-options]::-webkit-scrollbar-thumb { border-radius: 6px; background: #cbd5e1; }
body :is(#homePlatformPicker, #homeModelPicker) label[data-filter-option] { min-height: 40px; padding: 9px 10px; gap: 10px; align-items: center; font-weight: 400; }
body :is(#homePlatformPicker, #homeModelPicker) label[data-filter-option]:has(input:checked) { background: #f3f4f6; color: #111827; font-weight: 600; }
body :is(#homePlatformPicker, #homeModelPicker) label[data-filter-option]:hover,
body :is(#homePlatformPicker, #homeModelPicker) label[data-filter-option]:focus-within { background: #f3f4f6; }
body :is(#homePlatformPicker, #homeModelPicker) label[data-filter-option]:has(input:checked):hover,
body :is(#homePlatformPicker, #homeModelPicker) label[data-filter-option]:has(input:checked):focus-within { background: #e5e7eb; }
body :is(#homePlatformPicker, #homeModelPicker) label[data-filter-option] input[type="checkbox"] { width: 14px; height: 14px; accent-color: #374151; }
body :is(#homePlatformPicker, #homeModelPicker) label[data-filter-option] input:focus-visible { outline-color: #6b7280; }
body :is(#homePlatformPicker, #homeModelPicker) label[data-filter-option] span { min-width: 0; overflow-wrap: anywhere; }
body #homeModelPicker input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent-primary); }
body #homeModelPicker input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 3px; }
body .model-preset-options { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 12px; }
body .model-preset-label { padding-left: 8px; color: var(--text-secondary); font-size: 13px; white-space: nowrap; }
body .model-preset-segments { display: flex; align-items: center; gap: 2px; max-width: 100%; padding: 3px; border-radius: var(--radius-md); background: var(--bg-tertiary); }
body .model-preset-options button { min-width: 0; min-height: 32px; padding: 4px 12px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); font: inherit; font-size: 13px; line-height: 1.5; cursor: pointer; }
body .model-preset-options button:hover { background: var(--accent-soft); color: var(--text-primary); }
body .model-preset-options button:active { background: var(--bg-secondary); }
body .model-preset-options button[aria-pressed="true"] { border-color: var(--border-color); background: var(--bg-secondary); color: var(--accent-primary); font-weight: 600; box-shadow: var(--shadow-sm); }
body .model-preset-divider { flex: 0 0 1px; height: 14px; margin: 0 3px; background: var(--border-color); }
body .model-preset-error { margin: 0 0 8px; font-size: 12px; color: var(--text-secondary); }
body .model-preset-error button { border: 0; background: transparent; color: var(--accent-primary); font: inherit; padding: 6px; cursor: pointer; }
/* Multimodal is a visible selection shortcut, not an additional condition. */
body .model-multimodal-tools { position: relative; display: flex; align-items: center; gap: 6px; margin: 0 0 10px; }
body .model-multimodal-select { min-height: 32px; padding: 4px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: var(--bg-tertiary); color: var(--text-secondary); font: inherit; font-size: 13px; line-height: 1.5; cursor: pointer; }
body .model-multimodal-select:hover { background: var(--bg-secondary); border-color: var(--border-strong); color: var(--text-primary); }
body .model-multimodal-select:active { background: var(--bg-tertiary); }
body .model-multimodal-help { display: inline-flex; align-items: center; }
body .model-multimodal-info { display: inline-flex; align-items: center; justify-content: center; width: 32px; min-height: 32px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); cursor: pointer; }
body .model-multimodal-info > span { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border: 1px solid currentColor; border-radius: 50%; font-size: 11px; line-height: 1; font-weight: 500; }
body .model-multimodal-info:hover, body .model-multimodal-info[aria-expanded="true"] { color: var(--text-primary); background: var(--bg-tertiary); }
body .model-multimodal-select:focus-visible, body .model-multimodal-info:focus-visible { outline: 2px solid #6b7280; outline-offset: 2px; }
body .model-multimodal-tooltip { position: absolute; left: 0; top: calc(100% + 6px); z-index: 2; width: min(300px, 100%); box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-secondary); box-shadow: var(--shadow-md); color: var(--text-secondary); font-size: 12px; line-height: 1.65; }
body .model-multimodal-notice { margin: 0 0 10px; color: var(--text-secondary); font-size: 12px; line-height: 1.65; }
body .model-multimodal-tooltip[hidden], body .model-multimodal-notice[hidden] { display: none !important; }
/* Platform shortcuts change the checklist; they do not stay active as filters. */
body .platform-shortcut-tools { position: relative; margin: 0 0 12px; }
body .platform-shortcut-caption { display: flex; align-items: center; gap: 2px; margin-bottom: 4px; color: var(--text-secondary); font-size: 12px; }
body .platform-shortcut-help { display: inline-flex; align-items: center; }
body .platform-shortcut-actions { display: flex; flex-wrap: wrap; gap: 6px; }
body .platform-shortcut-actions button { flex: 1 1 148px; min-width: 0; min-height: 34px; padding: 5px 8px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: var(--bg-secondary); color: var(--text-secondary); font: inherit; font-size: 13px; line-height: 1.5; white-space: normal; cursor: pointer; }
body .platform-shortcut-actions button:hover { background: var(--bg-tertiary); color: var(--text-primary); border-color: var(--border-strong); }
body .platform-shortcut-actions button:focus-visible { outline: 2px solid #6b7280; outline-offset: 2px; }
@media (max-width: 800px), (pointer: coarse) {
  body .model-multimodal-select, body .model-multimodal-info, body .platform-shortcut-actions button { min-height: 44px; }
  body .model-multimodal-info { width: 44px; }
}
body .model-match-setting { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--border-light); }
body .filter-picker-menu .model-match-check { display: flex; padding: 6px 0; margin: 0; min-height: 36px; font-weight: 400; color: var(--text-primary); cursor: pointer; }
body .filter-picker-menu .model-match-check:hover { background: transparent; }
body .filter-picker-menu .model-match-check:has(input:checked) { background: transparent; }
body .model-match-setting[data-active="true"] .model-match-check { color: #92400e; font-weight: 500; }
body #homeModelPicker .model-match-setting[data-active="true"] input { accent-color: #92400e; }
body .model-match-setting > p { margin: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.65; }
body .model-match-confirm { padding: 12px; margin-top: 10px; border: 1px solid #f3d7af; border-radius: 8px; background: #fffaf2; color: #92400e; }
body .model-match-confirm p { margin: 0 0 10px; font-size: 13px; line-height: 1.65; }
body .model-match-confirm > div { display: flex; gap: 8px; flex-wrap: wrap; }
body .model-match-confirm button { min-height: 36px; padding: 6px 12px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; color: #4b5563; font: inherit; font-size: 13px; cursor: pointer; }
body .model-match-confirm button[data-model-match-action="confirm"] { border-color: #dfb884; background: #fff3df; color: #92400e; font-weight: 600; }
body .model-match-confirm button:hover { border-color: #9ca3af; }
body .model-preset-options button:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
body .model-match-confirm button:focus-visible { outline: 2px solid #6b7280; outline-offset: 2px; }
body .model-match-warning { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border: 1px solid #f0d4ac; border-radius: 5px; background: #fff7ea; color: #92400e; font-size: 11px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
body .guide-summary .model-match-warning { margin-left: 8px; }
body #homeModelPicker > summary { flex-wrap: wrap; }
body #homeModelPicker > summary::after { margin-left: auto; }
body .model-preset-options button:disabled, body .filter-picker-tools button:disabled { opacity: .5; cursor: wait; }
body :is(#homePlatformPicker, #homeModelPicker) [hidden] { display: none !important; }
@media (max-width: 800px) {
  body :is(#homePlatformPicker, #homeModelPicker) .filter-picker-menu { width: auto; }
  body :is(#homePlatformPicker, #homeModelPicker) .filter-picker-tools button, body :is(#homePlatformPicker, #homeModelPicker) label[data-filter-option] { min-height: 44px; }
  body .model-preset-options button, body .model-match-confirm button, body .filter-picker-menu .model-match-check { min-height: 44px; }
  body #homeModelPicker > summary [data-model-match-warning] { order: 4; flex-basis: auto; }
}
@media (pointer: coarse) {
  body .model-preset-options button, body :is(#homePlatformPicker, #homeModelPicker) .filter-picker-tools button { min-height: 44px; }
}

/* Home conditions and list utilities share one compact panel. */
body .home-filter-panel .guide-filter-fields { display: block; flex: 1 1 320px; margin: 0; padding: 0; border: 0; }
body .home-filter-panel #homeStatusPicker { min-width: 160px; max-width: min(100%, 280px); }
body .home-filter-panel #homeStatusPicker > summary { min-height: 40px; }
body .home-filter-panel .status-picker-title { flex-shrink: 0; white-space: nowrap; color: var(--text-secondary); }
body .home-filter-panel .filter-state-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 24px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-color); }
body .home-filter-panel .filter-checks { border: 0; padding: 0; }
body .home-filter-panel .filter-state-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; max-width: 100%; margin-left: auto; }
body .home-filter-panel .filter-state-footer .filter-state-actions { flex: 0 0 auto; width: auto; margin: 0; }
body .home-filter-panel .filter-state-hint { margin: 12px 0 0; }
body .offer-results-heading { align-items: flex-start; flex-wrap: wrap; gap: 12px 24px; }
body .offer-results-heading > div:first-child { flex: 1 1 300px; min-width: 0; }
body .offer-results-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; }
body .offer-results-title #offerCount { color: var(--text-secondary); font-size: 13px; font-weight: 400; white-space: nowrap; }
body .offer-sort { display: flex; align-items: center; gap: 8px; max-width: 100%; color: var(--text-secondary); font-size: 13px; }
body .offer-sort > span { flex-shrink: 0; }
body .offer-sort select { width: 15em; max-width: 100%; min-width: 0; min-height: 40px; color: var(--text-primary); font-size: 13px; }
body .offer-sort-help { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 800px) {
  body .offer-sort select, body .home-filter-panel #homeStatusPicker > summary { min-height: 44px; }
  body .home-filter-panel #homeStatusPicker { max-width: none; }
}
@media (max-width: 650px) {
  body .home-filter-panel #homeStatusPicker { grid-column: 1 / -1; width: fit-content; }
  body .home-filter-panel .filter-state-controls { width: 100%; margin-left: 0; gap: 12px; }
  body .home-filter-panel .offer-sort { flex: 1 1 100%; }
  body .home-filter-panel .offer-sort select { flex: 1; width: auto; }
  body .offer-results-heading > div:first-child { flex-basis: 100%; }
}

@media (max-width: 380px) {
  body .model-preset-label { padding-left: 4px; }
  body .model-preset-options { column-gap: 8px; }
  body .home-filter-panel #homeBudgetPicker, body .home-filter-panel #homeTokenPicker { grid-column: 1 / -1; }
}

/* 筛选：统一表单外观，并保持菜单的定位、滚动与完成操作。 */
body .filter-state-bar { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 12px; padding: 20px; box-shadow: none; }
body .filter-state-label { color: var(--text-primary); font-size: 14px; font-weight: 600; }
body .filter-state-chip { border: 0; border-radius: 4px; background: var(--bg-tertiary); color: var(--text-secondary); font-size: 12px; padding: 4px 8px; }
body .filter-picker > summary { background: var(--bg-secondary); border-color: var(--border-color); min-height: 44px; border-radius: 8px; font-size: 14px; }
body .filter-picker[open] > summary { border-color: var(--accent-primary); background: var(--accent-soft); }
body .filter-picker-menu { padding: 12px; }
body .filter-picker-menu label { border-radius: 6px; padding: 8px; font-size: 14px; line-height: 1.5; }
body .filter-picker-menu label:has(input:checked) { background: var(--accent-soft); }
body .filter-picker-menu label:hover { background: var(--bg-tertiary); }
body .filter-picker-tools { gap: 8px; }
body .filter-picker-tools button { min-height: 32px; border-radius: 6px; padding: 4px 8px; font-size: 13px; }
body .filter-picker-tools button:hover { background: var(--bg-tertiary); }
body :is(.filter-state-hint, .filter-help, .filter-subgroup, .filter-inline) { color: var(--text-secondary); font-size: 13px; }
body :is(.filter-more, .filter-subgroup) { border-color: var(--border-light); }
body .filter-state-actions button { border-color: var(--border-color); border-radius: 8px; font-size: 13px; }
body .filter-inline input[type="checkbox"] { width: 16px; }
