/* ==================== 快捷筛选标签 ==================== */
.quick-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 0 12px 0;
}
.filter-chip {
  padding: 4px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card-background);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
}
.filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.filter-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* mobile tweaks for cards and filters */
@media (max-width: 768px) {
  .quick-filters {
    padding: 4px 0;
    gap: 6px;
  }
  .filter-chip {
    padding: 3px 10px;
    font-size: 11px;
  }
}

/* search result info */
.search-result-info {
  padding: 6px 0 12px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ==================== 统计页面图表 ==================== */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 24px;
}
.chart-panel {
  background: var(--card-background);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  border: 1px solid var(--color-border-light);
  min-height: 360px;
  display: flex;
  flex-direction: column;
}
.chart-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  flex-shrink: 0;
}
.chart-box {
  width: 100%;
  flex: 1;
  min-height: 280px;
}
@media (max-width: 768px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .chart-box {
    min-height: 240px;
  }
  .chart-panel {
    min-height: 320px;
  }
}

/* 首页统计概览条 */
.overview-bar {
  background: var(--color-bg-surface);
  border-radius: 0;
  margin-bottom: 0;
  overflow: hidden;
  padding: 0 var(--page-margin);
  border-bottom: 1px solid var(--color-border-light);
}

.overview-bar + .search-bar {
  padding-top: 12px;
}

.overview-bar-row {
  display: flex;
  align-items: center;
  padding: 12px 20px;
}

.overview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.overview-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}

.overview-unit {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.overview-divider {
  width: 1px;
  height: 30px;
  background: var(--border);
  flex-shrink: 0;
}

.overview-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 8px;
  padding: 6px 12px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s;
}

.overview-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

[data-theme="dark"] .overview-bar {
  background: var(--color-bg-surface);
  border-bottom-color: var(--color-border-light);
}

[data-theme="dark"] .overview-value {
  color: var(--color-primary);
}

[data-theme="dark"] .overview-unit {
  color: var(--text-secondary);
}

[data-theme="dark"] .overview-divider {
  background: var(--color-border-light);
}

[data-theme="dark"] .overview-link {
  border-color: var(--color-border-light);
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .overview-bar-row {
    padding: 10px 14px;
  }
  .overview-value {
    font-size: 17px;
  }
  .overview-unit {
    font-size: 10px;
  }
  .overview-link {
    font-size: 11px;
    padding: 4px 8px;
  }
}

/* ===== 统计页面增强 ===== */

/* 数字卡片区 */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stats-cards-small {
  grid-template-columns: repeat(4, 1fr);
  margin-top: 16px;
}

.stat-card {
  background: var(--card-background);
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  padding: 16px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
  font-family: var(--font-heading);
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.growth-up { color: var(--color-success); }
.growth-down { color: var(--color-error); }

/* 统计区块标题 */
.stats-section {
  margin-bottom: 32px;
}

.stats-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border-light);
}

/* 地图可视化模块 */
.map-section {
  width: 100%;
}

.map-filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: var(--color-bg-surface);
  border-radius: var(--radius-base);
  border: 1px solid var(--color-border-light);
}

.map-filter-bar select {
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  min-width: 110px;
}

.map-hint {
  flex: 1;
  text-align: right;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
}

.map-hint .map-loading-hint {
  color: var(--color-primary);
  font-style: italic;
}

.map-approx-hint {
  color: var(--text-secondary);
  font-size: 12px;
}

/* 地图 5 箭头加载动画 */
.map-loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  background: var(--color-bg-surface);
  border-radius: 8px;
  border: 1px solid var(--color-border);
  min-height: 440px;
}
.map-loading-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 24px;
  letter-spacing: 2px;
}
.map-arrow-loader {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.map-arrow-loader .arrow {
  width: 22px;
  height: 22px;
  fill: var(--color-primary);
  opacity: 0;
  animation: mapArrowFade 1.2s ease-in-out infinite;
}
.map-arrow-loader .arrow:nth-child(1) { animation-delay: 0s; }
.map-arrow-loader .arrow:nth-child(2) { animation-delay: 0.15s; }
.map-arrow-loader .arrow:nth-child(3) { animation-delay: 0.3s; }
.map-arrow-loader .arrow:nth-child(4) { animation-delay: 0.45s; }
.map-arrow-loader .arrow:nth-child(5) { animation-delay: 0.6s; }
@keyframes mapArrowFade {
  0%, 100% { opacity: 0.12; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.15); }
}
.map-loading-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

[data-theme="dark"] .map-loading-container {
  background: var(--color-bg-surface);
  border-color: var(--color-border);
}
[data-theme="dark"] .map-loading-text {
  color: var(--text-secondary);
}

.map-chart-container {
  position: relative;
  width: 100%;
  background: var(--color-bg-surface);
  border-radius: var(--radius-base);
  overflow: hidden;
  border: 1px solid var(--color-border-light);
}

.map-chart {
  width: 100%;
  height: 560px;
}

/* 南海诸岛缩略图（右下角）：只显示南海区域，不叠加车站散点 */
.map-inset {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 180px;
  height: 200px;
  background: var(--color-bg-surface);
  border: 1.5px solid var(--color-border-light);
  border-radius: var(--radius-xs);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--color-text-primary) 12%, transparent);
  pointer-events: none;
}

/* 缩放控制按钮 */
.map-zoom-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}
.map-zoom-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--color-border-light);
  background: var(--color-bg-surface);
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.map-zoom-btn:hover {
  background: var(--color-primary);
  color: var(--color-text-primary);
  border-color: var(--color-primary);
}
.map-zoom-btn:active { transform: scale(0.95); }

.map-legend {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 13px;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 2px 4px color-mix(in srgb, var(--primary) 30%, transparent);
}

.legend-line {
  width: 26px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
}

@media (max-width: 768px) {
  .map-chart { height: 440px; }
  .map-inset { width: 140px; height: 160px; right: 8px; bottom: 8px; }
  .map-zoom-btn { width: 28px; height: 28px; font-size: 16px; }
}

@media (max-width: 480px) {
  .map-chart { height: 360px; }
  .map-inset { width: 110px; height: 130px; }
  .map-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .map-hint {
    justify-content: flex-start;
    text-align: left;
  }
}

[data-theme="dark"] .map-filter-bar { background: var(--color-bg-surface); border-color: var(--color-border); }
[data-theme="dark"] .map-filter-bar select {
  background: var(--color-bg-muted);
  border-color: var(--color-border);
  color: var(--text-primary);
}
[data-theme="dark"] .map-filter-bar select option {
  background: var(--color-bg-muted);
  color: var(--text-primary);
}
[data-theme="dark"] .map-chart-container { background: var(--color-bg-surface); border-color: var(--color-border); }
[data-theme="dark"] .map-inset { background: var(--color-bg-surface); border-color: var(--color-border); }
[data-theme="dark"] .map-zoom-btn {
  background: var(--color-bg-muted); color: var(--text-primary); border-color: var(--color-border);
}
[data-theme="dark"] .map-zoom-btn:hover {
  background: var(--color-primary); color: var(--color-text-inverse); border-color: var(--color-primary);
}
[data-theme="dark"] .map-hint { color: var(--color-text-secondary); }
[data-theme="dark"] .map-legend { color: var(--color-text-secondary); }
[data-theme="dark"] .map-hint .map-loading-hint { color: var(--color-primary); }
[data-theme="dark"] .station-card { background: var(--color-bg-surface); border-color: var(--color-border); color: var(--color-text-primary); }

/* 城市与车站列表 */
.city-station-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.city-station-group {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-light);
}
.city-station-group:last-child {
  border-bottom: none;
}
.city-station-city {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.city-station-city-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}
.city-station-city-count {
  font-size: 12px;
  color: var(--text-tertiary);
  background: var(--color-border-light);
  padding: 2px 8px;
  border-radius: 99px;
}
.city-station-stations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.city-station-station {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
}
.city-station-station-name {
  color: var(--text-primary);
  font-weight: 500;
}
.city-station-station-first {
  color: var(--text-tertiary);
  font-size: 11px;
}
[data-theme="dark"] .city-station-station {
  background: rgba(255,255,255,0.06);
}

/* 图表网格 */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.chart-panel {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.chart-panel-full {
  grid-column: 1 / -1;
}

.chart-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.chart-box {
  height: 280px;
}

/* 排行榜 */
.station-ranking,
.train-ranking {
  background: var(--card-background);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-base);
  overflow: hidden;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-light);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.ranking-item:last-child {
  border-bottom: none;
}

.ranking-item:hover {
  background: var(--primary-light);
}

.ranking-num {
  width: 24px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
  flex-shrink: 0;
}

.ranking-name {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 80px;
}

.ranking-bar {
  flex: 1;
  height: 8px;
  background: var(--background-light);
  border-radius: var(--radius-xs);
  overflow: hidden;
  min-width: 60px;
}

.ranking-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-xs);
  transition: width 0.4s ease;
}

.ranking-count {
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
  min-width: 50px;
  text-align: right;
}

.ranking-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* 里程碑徽章 */
.milestones-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.milestone-card {
  background: var(--card-background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.milestone-card:hover {
  border-color: var(--primary);
}

.milestone-card.maxed {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--card-background), color-mix(in srgb, var(--color-primary) 5%, transparent));
}

.milestone-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}

.milestone-card-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background-light);
  border-radius: var(--radius-md);
}

.milestone-card-main {
  flex: 1;
  min-width: 0;
}

.milestone-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.milestone-card-level {
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 2px;
}

.milestone-card.maxed .milestone-card-level {
  color: var(--success);
}

.milestone-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.milestone-card-expand {
  flex-shrink: 0;
  color: var(--text-secondary);
  transition: transform 0.25s;
}

.milestone-card-expand.rotated {
  transform: rotate(180deg);
}

.milestone-progress-bar {
  height: 4px;
  background: var(--background-light);
  margin: 0 16px;
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.milestone-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-xs);
  transition: width 0.6s ease;
}

.milestone-card.maxed .milestone-progress-fill {
  background: var(--success);
}

.milestone-progress-text {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px 16px 12px;
}

.milestone-levels {
  border-top: 1px solid var(--border);
  padding: 8px 0;
}

.milestone-level {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  transition: background 0.15s;
}

.milestone-level.reached {
  opacity: 0.65;
}

.milestone-level.current {
  background: var(--primary-light);
}

.milestone-level.next {
  background: color-mix(in srgb, var(--color-primary) 4%, transparent);
}

.milestone-level-dot {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.milestone-level.reached .milestone-level-dot {
  color: var(--primary);
}

.milestone-level:not(.reached) .milestone-level-dot {
  color: var(--border);
}

.milestone-level-info {
  flex: 1;
  min-width: 0;
}

.milestone-level-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 1px;
}

.milestone-level-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

.milestone-level-target {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* 响应式 */
@media (max-width: 1024px) {
  .stats-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .stats-cards { grid-template-columns: repeat(2, 1fr); }
  .stats-cards-small { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .chart-box { height: 220px; }
}

@media (max-width: 480px) {
  .stats-cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-value { font-size: 18px; }
}

/* 暗色模式适配 */
[data-theme="dark"] .stat-card,
[data-theme="dark"] .chart-panel,
[data-theme="dark"] .station-ranking,
[data-theme="dark"] .train-ranking,
[data-theme="dark"] .milestone-card {
  background: var(--card-background);
}

[data-theme="dark"] .milestone-card-icon {
  background: var(--background-light);
}

[data-theme="dark"] .ranking-bar {
  background: rgba(255,255,255,0.08);
}



/* 空状态 */
.chart-empty {
  height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  background: var(--card-background);
  border-radius: var(--radius-sm);
}

[data-theme="dark"] .chart-empty {
  color: var(--text-secondary);
}

/* 搜索历史下拉 */
.search-history-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-background);
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  margin-top: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 100;
  overflow: hidden;
}

.search-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

.clear-history-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}

.clear-history-btn:hover {
  text-decoration: underline;
}

.search-history-list {
  max-height: 250px;
  overflow-y: auto;
}

.search-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text-primary);
  transition: background 0.2s;
}

.search-history-item:hover {
  background: var(--background-light);
}

.search-history-item svg {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.search-history-item span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==================== 搜索建议面板 ==================== */
.suggestion-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-background);
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  margin-top: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 200;
  overflow: hidden;
  animation: fadeInDown 0.15s ease;
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.suggestion-section {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.suggestion-section:last-child {
  border-bottom: none;
}
.suggestion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 14px 8px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}
.suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 14px;
  transition: background 0.15s;
}
.suggestion-item:hover {
  background: var(--background-light);
}
.suggestion-item mark {
  background: var(--color-warning-bg, #fef3c7);
  color: var(--text-primary);
  border-radius: 2px;
  padding: 0 2px;
}
.suggestion-history-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.suggestion-history-item svg {
  color: var(--text-secondary);
  flex-shrink: 0;
}
.hot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 14px 10px;
}
.hot-suggestion-chip {
  display: inline-block;
  padding: 4px 12px;
  background: var(--background-light);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}
.hot-suggestion-chip:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ==================== 筛选按钮 ==================== */
.filter-toggle-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: var(--background-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-ui);
  transition: all 0.2s;
  white-space: nowrap;
  position: relative;
}
.filter-toggle-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.filter-toggle-btn.has-filters {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}
.filter-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

/* ==================== 筛选摘要 ==================== */
.filter-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  max-width: 800px;
  margin: 0 auto;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  border-radius: 16px;
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s;
}
.filter-chip:hover {
  background: color-mix(in srgb, var(--primary) 20%, transparent);
}
.filter-chip svg {
  flex-shrink: 0;
}
.clear-all-filters-btn {
  padding: 4px 10px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font-ui);
}
.clear-all-filters-btn:hover {
  color: var(--primary);
}

/* ==================== 搜索结果栏 + 状态分组标签 ==================== */
.search-result-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 800px;
  margin: 20px auto 16px;
  padding: 0 16px;
}
.status-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 4px;
  min-width: 0;
  background: var(--background-light);
  border-radius: 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.status-tabs::-webkit-scrollbar { display: none; }
.status-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: all 0.22s;
  white-space: nowrap;
  position: relative;
}
.status-tab-btn:hover:not(.disabled) {
  color: var(--text-primary);
  background: var(--color-bg-hover);
}
.status-tab-btn.active {
  background: var(--card-background);
  color: var(--primary);
  font-weight: 650;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.status-tab-btn.disabled {
  color: var(--text-tertiary);
  cursor: default;
}
.status-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  transition: all 0.22s;
}
.status-tab-btn.active .status-tab-count {
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  color: var(--primary);
}
.sort-toggle {
  margin-left: auto;
  flex-shrink: 0;
  padding-left: 8px;
}
.sort-select {
  padding: 7px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--card-background);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: border-color 0.2s;
}
.sort-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* ==================== 筛选弹窗 ==================== */
.filter-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-fade-enter-active { transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); }
.modal-fade-leave-active { transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1); }
.modal-fade-enter-from { opacity: 0; }
.modal-fade-leave-to { opacity: 0; }
.modal-fade-enter-from .filter-modal { transform: scale(0.95) translateY(8px); }
.modal-fade-leave-to .filter-modal { transform: scale(0.95) translateY(8px); }

.filter-modal {
  width: 440px;
  max-width: 100%;
  max-height: 85vh;
  background: var(--card-background);
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.filter-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  flex-shrink: 0;
}
.filter-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.filter-modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background-light);
  border: none;
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.filter-modal-close:hover {
  background: var(--color-bg-hover);
  color: var(--text-primary);
}

.filter-modal-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 24px 8px;
}
.filter-section {
  margin-bottom: 22px;
}
.filter-section:last-child { margin-bottom: 0; }
.filter-section-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

/* Unified inputs */
.filter-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--background-light);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-ui);
  box-sizing: border-box;
  transition: border-color 0.2s, background 0.2s;
}
.filter-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--card-background);
}

/* Date row */
.filter-date-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.filter-date-row .filter-input { flex: 1; }
.filter-date-sep {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}
.filter-quick-dates {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.filter-chip-btn {
  flex: 1;
  padding: 8px 0;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--card-background);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-ui);
  transition: all 0.2s;
}
.filter-chip-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 4%, transparent);
}

/* 行程状态筛选（移动端在筛选抽屉内，桌面端隐藏） */
.filter-status-section { display: none; }
.filter-status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-status-chip {
  flex: 0 0 auto;
  padding: 6px 12px;
  font-size: 13px;
}
.filter-status-chip.active {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--color-primary) 6%, transparent);
  font-weight: 600;
}
.filter-status-chip:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* Checkbox group — 改用 chip 按钮 */
.seat-category-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}
.seat-category-tab {
  flex: none;
  padding: 6px 16px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--background-light);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}
.seat-category-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.seat-category-tab.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
[data-theme="dark"] .seat-category-tab {
  background: rgba(255,255,255,0.04);
  border-color: var(--color-border);
  color: var(--text-tertiary);
}
[data-theme="dark"] .seat-category-tab:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
[data-theme="dark"] .seat-category-tab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-text-inverse);
}
.seat-category-manage {
  margin-left: auto;
  padding: 6px 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 12px;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: color 0.18s ease;
  user-select: none;
}
.seat-category-manage:hover {
  color: var(--primary);
}

.filter-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-seat-chip {
  flex: none;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--background-light);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}
.filter-seat-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 4%, transparent);
}
.filter-seat-chip.active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  font-weight: 600;
}
[data-theme="dark"] .filter-seat-chip {
  background: rgba(255,255,255,0.04);
  border-color: var(--color-border);
  color: var(--text-tertiary);
}
[data-theme="dark"] .filter-seat-chip:hover {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  border-color: var(--color-border);
  color: var(--primary);
}
[data-theme="dark"] .filter-seat-chip.active {
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  border-color: var(--primary);
  color: var(--primary);
}

/* Station search */
.station-search-wrapper { position: relative; }
.station-filter-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--card-background);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 10;
  max-height: 220px;
  overflow-y: auto;
}
.suggestion-chip {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  transition: background 0.12s;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 0;
}
.suggestion-chip:hover { background: var(--background-light); }
.suggestion-chip:first-child { border-radius: 12px 12px 0 0; }
.suggestion-chip:last-child { border-radius: 0 0 12px 12px; }
.suggestion-chip:only-child { border-radius: 12px; }
.station-code {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: monospace;
}
.filter-selected-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 7px 14px;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
}
.tag-remove {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 16px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.tag-remove:hover { opacity: 1; }

/* Footer */
.filter-modal-footer {
  display: flex;
  gap: 12px;
  padding: 16px 24px 20px;
  flex-shrink: 0;
}
.filter-modal-footer button {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-ui);
  transition: all 0.2s;
}
.filter-btn-secondary {
  background: var(--background-light);
  border: 1.5px solid var(--border);
  color: var(--text-primary);
}
.filter-btn-secondary:hover {
  background: var(--color-bg-hover);
  border-color: var(--text-secondary);
}
.filter-btn-primary {
  background: var(--primary);
  border: none;
  color: #fff;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 30%, transparent);
}
.filter-btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 40%, transparent);
}

