.quant-filter-shell {
  display: grid;
  gap: 14px;
}

.quant-filter-intro,
.quant-filter-controls,
.quant-filter-results,
.quant-filter-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.quant-filter-intro {
  margin: 0;
  padding: 13px 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.quant-filter-intro strong {
  color: var(--text);
}

.quant-filter-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  background: var(--surface-2);
}

.quant-filter-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.quant-filter-field label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.quant-filter-field select {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
}

.quant-filter-toolbar,
.quant-filter-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quant-filter-toolbar {
  grid-column: 1 / -1;
  padding-top: 2px;
}

.quant-filter-toolbar button,
.quant-filter-more,
.quant-radar-link {
  border: 1px solid color-mix(in srgb, var(--accent) 56%, var(--line));
  border-radius: 6px;
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent-soft) 88%, var(--surface));
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.quant-filter-toolbar button,
.quant-filter-more {
  min-height: 34px;
  padding: 7px 11px;
}

.quant-filter-results {
  min-width: 0;
  overflow: hidden;
}

.quant-filter-results-head {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.quant-filter-results-head strong {
  font-size: 14px;
  font-weight: 800;
}

.quant-filter-results-head span {
  color: var(--muted);
  font-size: 11px;
}

.quant-filter-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.quant-filter-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  font-size: 12px;
}

.quant-filter-table th,
.quant-filter-table td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.quant-filter-table th {
  color: #ffffff;
  background: linear-gradient(180deg, #2f6bff, #2563eb);
  font-size: 10px;
  font-weight: 800;
}

.quant-filter-table th:first-child,
.quant-filter-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 132px;
  max-width: 132px;
  text-align: left;
  background: #eff6ff;
}

.quant-filter-table th:first-child {
  background: linear-gradient(180deg, #1d4ed8, #1e40af);
  color: #ffffff;
}

.quant-stock-name {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.quant-stock-name strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #1e40af;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quant-stock-name span,
.quant-updated {
  color: var(--muted);
  font-size: 10px;
}

.quant-radar-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 8px;
}

.quant-filter-table td:first-child {
  color: #1e40af;
  font-weight: 700;
}

.quant-filter-table td:first-child span {
  color: color-mix(in srgb, #1e40af 72%, white);
}

.quant-filter-toolbar button:hover,
.quant-filter-more:hover,
.quant-radar-link:hover {
  background: color-mix(in srgb, var(--accent-soft) 100%, white);
  border-color: color-mix(in srgb, var(--accent) 68%, var(--line));
  text-decoration: none;
}

.quant-filter-empty {
  padding: 28px 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.quant-filter-skeleton {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.quant-filter-skeleton span {
  height: 38px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 220% 100%;
  animation: quant-filter-pulse 1.25s linear infinite;
}

.quant-filter-more-wrap {
  display: flex;
  justify-content: center;
  padding: 12px;
}

.quant-filter-note {
  margin: 0;
  padding: 13px 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

@keyframes quant-filter-pulse {
  to { background-position: -220% 0; }
}

@media (max-width: 900px) {
  .quant-filter-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .quant-filter-controls {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
  }

  .quant-filter-field select {
    min-height: 36px;
    padding: 6px 7px;
    font-size: 11px;
  }

  .quant-filter-toolbar,
  .quant-filter-results-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .quant-filter-toolbar button {
    width: 100%;
  }

  .quant-filter-results-head {
    padding: 11px 12px;
  }

  .quant-filter-table {
    min-width: 800px;
  }

  .quant-filter-table th,
  .quant-filter-table td {
    padding: 8px 6px;
  }

  .quant-filter-table th:first-child,
  .quant-filter-table td:first-child {
    min-width: 82px;
    max-width: 82px;
  }

  .quant-stock-name strong {
    display: block;
    max-width: 78px;
    font-size: 11px;
  }

  .quant-stock-name span {
    display: none !important;
  }

  .quant-filter-table th:nth-child(2),
  .quant-filter-table td:nth-child(2),
  .quant-filter-table th:nth-child(3),
  .quant-filter-table td:nth-child(3),
  .quant-filter-table th:nth-child(5),
  .quant-filter-table td:nth-child(5),
  .quant-filter-table th:nth-child(7),
  .quant-filter-table td:nth-child(7) {
    min-width: 72px;
  }

  .quant-filter-table th:nth-child(8),
  .quant-filter-table td:nth-child(8) {
    min-width: 88px;
  }
}

@media (max-width: 380px) {
  .quant-filter-controls {
    grid-template-columns: 1fr;
  }
}

body:not(.light) .quant-filter-table th {
  background: #1e3a8a;
}

body:not(.light) .quant-filter-table td:first-child {
  background: rgba(96, 165, 250, 0.14);
  color: #bfdbfe;
}

body:not(.light) .quant-stock-name strong {
  color: #bfdbfe;
}

body:not(.light) .quant-filter-table td:first-child span {
  color: rgba(191, 219, 254, 0.82);
}
