/* plugins/台股篩選器/frontend/screener.css */
.stockScreener-view {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.screener-filter-panel {
  padding: 8px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}
.screener-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-end;
}
.screener-advanced-row {
  margin-top: 2px;
  padding-top: 6px;
  border-top: 1px dashed #e5e7eb;
}
.screener-advanced-warning {
  margin-top: 6px;
  padding: 4px 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  font-size: 10px;
  color: #92400e;
  line-height: 1.4;
}
.screener-filter-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.screener-filter-label {
  font-size: 10px;
  color: #6b7280;
  font-weight: 500;
}
.screener-filter-input {
  width: 82px;
  height: 28px;
  padding: 3px 6px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 12px;
  outline: none;
}
.screener-filter-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.screener-market-chips {
  display: flex;
  gap: 6px;
}
.screener-market-chip {
  padding: 4px 12px;
  border: 1px solid #d1d5db;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  background: #fff;
  color: #6b7280;
  user-select: none;
  transition: all 0.15s;
}
.screener-market-chip.active {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}
.screener-industry-group {
  position: relative;
}
.screener-industry-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.screener-industry-popover {
  position: relative;
  flex-shrink: 0;
}
.screener-industry-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 130px;
  padding: 5px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  color: #374151;
  outline: none;
  text-align: left;
}
.screener-industry-trigger:hover {
  border-color: #3b82f6;
}
.screener-industry-trigger.open {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.screener-industry-chevron {
  font-size: 10px;
  color: #9ca3af;
  flex-shrink: 0;
}
.screener-industry-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  width: 220px;
  max-height: 260px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 20;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.screener-industry-actions {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid #f3f4f6;
}
.screener-industry-quick {
  flex: 1;
  padding: 4px 0;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  background: #f9fafb;
  color: #6b7280;
  text-align: center;
  transition: all 0.15s;
}
.screener-industry-quick:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #2563eb;
}
.screener-industry-list {
  overflow-y: auto;
  max-height: 200px;
  padding: 4px 0;
}
.screener-industry-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  color: #374151;
  transition: background 0.1s;
}
.screener-industry-check:hover {
  background: #f3f4f6;
}
.screener-industry-check.checked {
  background: #eff6ff;
  font-weight: 500;
}
.screener-industry-check input[type=checkbox] {
  accent-color: #3b82f6;
  width: 15px;
  height: 15px;
  cursor: pointer;
  flex-shrink: 0;
}
.screener-industry-empty {
  padding: 12px;
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
}
.screener-industry-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.screener-industry-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  font-size: 11px;
  color: #2563eb;
  white-space: nowrap;
}
.screener-industry-chip-x {
  background: none;
  border: none;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  color: #93c5fd;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transition: all 0.1s;
}
.screener-industry-chip-x:hover {
  background: #bfdbfe;
  color: #1d4ed8;
}
.screener-preset-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}
.screener-preset-category {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0;
}
.screener-preset-category-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.screener-preset-cat-label {
  font-size: 10px;
  color: #9ca3af;
  font-weight: 600;
  white-space: nowrap;
  min-width: 78px;
  text-align: left;
  padding: 4px 8px 0 0;
  border-right: 1px solid #e5e7eb;
  margin-right: 8px;
  flex-shrink: 0;
}
.screener-preset-row {
  display: flex;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}
.screener-preset-chip {
  padding: 3px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font-size: 11px;
  cursor: pointer;
  background: #fff;
  color: #6b7280;
  user-select: none;
  transition: all 0.15s;
}
.screener-preset-chip:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #2563eb;
}
.screener-preset-chip.active {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #2563eb;
  font-weight: 600;
}
.screener-preset-methodology {
  font-size: 11px;
  line-height: 1.5;
  color: #6b7280;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  padding: 6px 10px;
  margin-top: 2px;
}
.screener-results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  font-size: 12px;
  color: #6b7280;
  border-bottom: 1px solid #f3f4f6;
}
.screener-results-count {
  font-weight: 500;
}
.screener-results-count strong {
  color: #374151;
}
.screener-scroll-hint {
  padding: 4px 16px;
  font-size: 10px;
  color: #9ca3af;
  text-align: center;
  background: #fafafa;
  border-bottom: 1px solid #f3f4f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.screener-table-wrap {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.screener-table-wrap::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 28px;
  background:
    linear-gradient(
      to right,
      transparent,
      rgba(0, 0, 0, 0.08));
  pointer-events: none;
  z-index: 4;
  border-radius: 0 6px 6px 0;
}
.screener-table-hscroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.screener-table {
  min-width: 950px;
  border-collapse: collapse;
  font-size: 13px;
}
.screener-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f9fafb;
  padding: 8px 10px;
  text-align: right;
  font-weight: 500;
  color: #6b7280;
  font-size: 11px;
  border-bottom: 2px solid #e5e7eb;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.screener-table th:first-child,
.screener-table th:nth-child(2) {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #f9fafb;
}
.screener-table th:first-child {
  left: 0;
  min-width: 60px;
  text-align: left;
}
.screener-table th:nth-child(2) {
  left: 60px;
  min-width: 80px;
  text-align: left;
  padding-left: 4px;
}
.screener-table td:first-child,
.screener-table td:nth-child(2) {
  position: sticky;
  z-index: 1;
  background: #fff;
}
.screener-table td:first-child {
  left: 0;
  text-align: left;
}
.screener-table td:nth-child(2) {
  left: 60px;
  text-align: left;
  padding-left: 4px;
}
.screener-table tr:hover td:first-child,
.screener-table tr:hover td:nth-child(2) {
  background: #f9fafb;
}
.screener-table th:hover {
  color: #374151;
}
.screener-table th.sort-active {
  color: #2563eb;
}
.screener-table td {
  padding: 7px 10px;
  text-align: right;
  border-bottom: 1px solid #f3f4f6;
  white-space: nowrap;
}
.screener-table td:first-child {
  text-align: left;
}
.screener-table tr:hover td {
  background: #f9fafb;
}
.screener-code {
  font-weight: 600;
  color: #374151;
}
.screener-name {
  color: #6b7280;
  font-size: 12px;
}
.screener-up {
  color: #ef4444;
}
.screener-down {
  color: #22c55e;
}
.screener-yield-high {
  color: #ef4444;
  font-weight: 600;
}
.screener-industry-tag {
  display: inline-block;
  padding: 1px 8px;
  background: #f3f4f6;
  border-radius: 10px;
  font-size: 11px;
  color: #6b7280;
}
.screener-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  gap: 8px;
}
.screener-empty-icon {
  font-size: 40px;
}
.screener-empty-text {
  font-size: 14px;
}
.screener-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7280;
  font-size: 13px;
}
.screener-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: screener-spin 0.7s linear infinite;
}
@keyframes screener-spin {
  to {
    transform: rotate(360deg);
  }
}
.screener-error {
  color: #ef4444;
  font-size: 13px;
  padding: 16px;
  text-align: center;
}
.screener-row {
  transition: background 0.1s;
}
.screener-row-expanded td {
  background: #f0f7ff !important;
}
.screener-watch-btn {
  width: 28px;
  height: 28px;
  border: 1.5px solid #d1d5db;
  border-radius: 50%;
  background: #fff;
  color: #6b7280;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
  line-height: 1;
}
.screener-watch-btn:hover:not(:disabled) {
  border-color: #3b82f6;
  color: #3b82f6;
  background: #eff6ff;
}
.screener-watch-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.screener-watch-added {
  color: #3b82f6;
  font-size: 14px;
  font-weight: 700;
}
.screener-detail-row td {
  padding: 0;
}
.screener-detail-panel {
  padding: 14px 16px;
  background: #f8faff;
  border-top: 1px solid #e5e7eb;
  animation: screenerDetailIn 0.2s ease-out;
}
@keyframes screenerDetailIn {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
  }
}
.screener-detail-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}
.screener-detail-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}
.screener-detail-market {
  font-size: 11px;
  color: #9ca3af;
}
.screener-detail-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.screener-indicator-card {
  flex: 1 1 100px;
  min-width: 90px;
  max-width: 160px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}
.screener-indicator-label {
  font-size: 10px;
  color: #9ca3af;
  font-weight: 500;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.screener-indicator-value {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}
.screener-indicator-sub {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 1px;
}
.screener-detail-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7280;
  font-size: 13px;
  padding: 8px 0;
}
.screener-detail-error {
  color: #ef4444;
  font-size: 12px;
  padding: 4px 0;
}
.screener-detail-actions {
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 8px;
}
.screener-detail-watch-btn {
  padding: 6px 16px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.screener-detail-watch-btn:hover:not(:disabled) {
  background: #2563eb;
}
.screener-detail-watch-btn:disabled {
  background: #93c5fd;
  cursor: not-allowed;
}
.screener-detail-watched {
  color: #3b82f6;
  font-size: 13px;
  font-weight: 500;
}
.screener-delete-btn {
  width: 24px;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: #9ca3af;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
  line-height: 1;
}
.screener-delete-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: #fef2f2;
}
.screener-detail-delete-btn {
  padding: 6px 16px;
  background: transparent;
  color: #ef4444;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.screener-detail-delete-btn:hover {
  background: #fef2f2;
  border-color: #ef4444;
}
.screener-table th:last-child {
  position: sticky;
  right: 0;
  z-index: 3;
  background: #f9fafb;
  text-align: center;
}
.screener-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  background: #fff;
  text-align: center;
}
.screener-row-expanded td:last-child {
  background: #f0f7ff !important;
}
.screener-table tr:hover td:last-child {
  background: #f9fafb;
}
.screener-row-expanded:hover td:last-child {
  background: #f0f7ff !important;
}
.screener-tech-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background:
    linear-gradient(
      135deg,
      #f0f4ff 0%,
      #faf5ff 100%);
  border-bottom: 1px solid #e5e7eb;
  font-size: 12px;
}
.screener-tech-section-label {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  margin-right: 4px;
  white-space: nowrap;
}
.screener-tech-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.screener-tech-chip {
  padding: 4px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  background: #fff;
  color: #6b7280;
  user-select: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.screener-tech-chip:hover {
  border-color: #93c5fd;
  color: #2563eb;
  background: #eff6ff;
}
.screener-tech-chip.active {
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.screener-tech-chip.active.phase1 {
  background: #ef4444;
}
.screener-tech-chip.active.phase2 {
  background: #3b82f6;
}
.screener-tech-chip.active.exit {
  background: #22c55e;
}
.screener-tech-loading {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #9ca3af;
  font-size: 11px;
  margin-left: 8px;
}
.screener-tech-count {
  color: #6b7280;
  font-size: 11px;
  margin-left: 8px;
}
.screener-tech-count strong {
  color: #374151;
  font-weight: 700;
}
.screener-tech-badges {
  display: inline-flex;
  gap: 3px;
  margin-left: 6px;
  vertical-align: middle;
  flex-wrap: wrap;
}
.screener-tech-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.screener-tech-badge.phase1-strongest {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}
.screener-tech-badge.phase1-secondary {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.screener-tech-badge.phase1-tertiary {
  background: #fff5f5;
  color: #ef4444;
  border: 1px solid #fee2e2;
}
.screener-tech-badge.phase2-signal {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}
.screener-tech-badge.exit-full {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}
.screener-tech-badge.exit-partial {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}
.screener-criteria-bar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 16px;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  font-size: 11px;
  color: #92400e;
}
.screener-criteria-bar-icon {
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}
.screener-criteria-bar-text {
  flex: 1;
  line-height: 1.5;
  min-width: 0;
}
.screener-criteria-bar-rename-btn {
  flex-shrink: 0;
  padding: 2px 8px;
  border: 1px solid #fcd34d;
  border-radius: 4px;
  background: #fff;
  color: #92400e;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  margin-top: 1px;
}
.screener-criteria-bar-rename-btn:hover {
  background: #fef3c7;
  border-color: #f59e0b;
}
.screener-rename-input {
  flex: 1;
  padding: 3px 8px;
  border: 1px solid #f59e0b;
  border-radius: 4px;
  font-size: 12px;
  outline: none;
  background: #fff;
}
.screener-rename-input:focus {
  border-color: #d97706;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}
.screener-tech-sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
  padding: 2px 4px;
  border-radius: 4px;
}
.screener-tech-sortable:hover {
  background: rgba(0, 0, 0, 0.05);
}
.screener-tech-sortable.sort-active {
  background: rgba(59, 130, 246, 0.1);
  font-weight: 700;
}
.screener-sort-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #f9fafb;
  font-size: 10px;
  color: #9ca3af;
  vertical-align: middle;
  transition: all 0.15s;
}
.screener-tech-sortable:hover .screener-sort-badge {
  border-color: #3b82f6;
  color: #2563eb;
  background: #eff6ff;
}
.screener-sort-badge.active {
  border-color: #3b82f6;
  color: #fff;
  background: #3b82f6;
  font-weight: 700;
}
.screener-filter-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 4px 0;
  margin-bottom: 6px;
  border: none;
  background: none;
  font-size: 11px;
  color: #9ca3af;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s;
}
.screener-filter-toggle:hover {
  color: #6b7280;
}
.screener-filter-toggle.expanded {
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid #f3f4f6;
}
.screener-filter-toggle-arrow {
  font-size: 9px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}
.screener-filter-toggle-hint {
  font-size: 10px;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.screener-filter-toggle-hint.empty {
  color: #d1d5db;
  font-style: italic;
}
