/* 车站列表页面样式 */

/* 主布局 */
.list-layout {
  display: grid;
  grid-template-columns: 300px 1fr 280px;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  min-height: calc(100vh - 200px);
}

/* 控制面板 */
.list-controls {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  height: fit-content;
  position: sticky;
  top: 20px;
  width: 300px; /* 固定宽度 */
  flex-shrink: 0; /* 防止收缩 */
}

.control-group {
  margin-bottom: 20px;
}

.control-group:last-child {
  margin-bottom: 0;
}

.control-label {
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  font-size: 14px;
}

.search-box {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s;
  user-select: text; /* 允许搜索框文本被选中 */
  -webkit-user-select: text; /* Safari支持 */
  -moz-user-select: text; /* Firefox支持 */
  -ms-user-select: text; /* IE支持 */
}

.search-box:focus {
  outline: none;
  border-color: #007bff;
}

.filter-buttons, .sort-buttons, .sort-direction-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-btn, .sort-btn, .direction-btn {
  padding: 6px 12px;
  border: 1px solid #ddd;
  background: #f8f9fa;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
  margin: 2px;
  user-select: none; /* 防止文本被选中 */
  -webkit-user-select: none; /* Safari支持 */
  -moz-user-select: none; /* Firefox支持 */
  -ms-user-select: none; /* IE支持 */
}

.filter-btn:hover, .sort-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.filter-btn.active, .sort-btn.active {
  background: white;
  color: #007bff;
  border-color: #007bff;
  border-width: 2px;
  outline: 2px solid rgba(0, 123, 255, 0.2);
  outline-offset: -2px;
}

/* 排序方向按钮样式 */
.direction-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.direction-btn.active {
  background: white;
  color: #007bff;
  border-color: #007bff;
  border-width: 2px;
  outline: 2px solid rgba(0, 123, 255, 0.2);
  outline-offset: -2px;
}

/* 归属筛选按钮特殊样式 */
.affiliation-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  max-width: 36px;
  max-height: 36px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: #f8f9fa;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  user-select: none; /* 防止文本被选中 */
  -webkit-user-select: none; /* Safari支持 */
  -moz-user-select: none; /* Firefox支持 */
  -ms-user-select: none; /* IE支持 */
}

.affiliation-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.affiliation-btn.active {
  background: white;
  color: #007bff;
  border-color: #007bff;
  border-width: 2px;
  outline: 2px solid rgba(0, 123, 255, 0.2);
  outline-offset: -2px;
}

.affiliation-btn .affiliation-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.affiliation-btn .affiliation-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* 列表容器 */
.list-container {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 500px; /* 增加最小宽度 */
  width: 100%; /* 确保宽度占满 */
  flex: 1; /* 确保容器能够扩展 */
  min-height: 600px; /* 添加最小高度确保有足够空间 */
}

.list-header {
  padding: 15px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 60px; /* 固定头部高度 */
}

.list-stats {
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: #666;
}

.list-stats span {
  font-weight: 500;
}

/* 车站列表 */
.station-list {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  min-width: 500px; /* 增加最小宽度 */
  width: 100%; /* 确保宽度占满容器 */
  min-height: 400px; /* 添加最小高度 */
}

.station-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.3s;
  cursor: pointer;
  min-height: 80px; /* 固定每个项目的最小高度 */
  user-select: none; /* 防止整个项目被选中 */
  -webkit-user-select: none; /* Safari支持 */
  -moz-user-select: none; /* Firefox支持 */
  -ms-user-select: none; /* IE支持 */
}

.station-item:hover {
  background-color: #f8f9fa;
}

.station-thumbnail {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  margin-right: 15px;
  flex-shrink: 0;
  background-color: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 12px;
}

.station-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.station-thumbnail.error {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
}

.station-info {
  flex: 1;
  min-width: 0;
}

.station-name {
  font-weight: 600;
  color: #333;
  font-size: 14px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: text; /* 允许车站名称被选中 */
  -webkit-user-select: text; /* Safari支持 */
  -moz-user-select: text; /* Firefox支持 */
  -ms-user-select: text; /* IE支持 */
}

.station-remark {
  color: #666;
  font-size: 12px;
  font-style: italic;
}

.station-details {
  display: flex;
  gap: 15px;
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

.station-location {
  display: flex;
  align-items: center;
  gap: 4px;
}

.station-affiliation {
  display: flex;
  align-items: center;
  gap: 4px;
}

.affiliation-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.station-link {
  color: #007bff;
  text-decoration: none;
  transition: color 0.3s;
}

.station-link:hover {
  color: #0056b3;
  text-decoration: underline;
}

/* 信息面板 */
.info-panel {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  height: fit-content;
  position: sticky;
  top: 20px;
  width: 280px; /* 固定宽度 */
  flex-shrink: 0; /* 防止收缩 */
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #2751a0;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: background-color 0.3s;
  margin-bottom: 20px;
  user-select: none; /* 防止文本被选中 */
  -webkit-user-select: none; /* Safari支持 */
  -moz-user-select: none; /* Firefox支持 */
  -ms-user-select: none; /* IE支持 */
}

.back-button:hover {
  background: #0056b3;
}

.quick-actions {
  margin-bottom: 20px;
}

.action-label {
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  font-size: 14px;
}

.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: #f8f9fa;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid #e9ecef;
    min-height: 60px;
    justify-content: center;
    flex-shrink: 0; /* 防止按钮被压缩 */
    min-width: 80px; /* 设置最小宽度 */
    user-select: none; /* 防止文本被选中 */
    -webkit-user-select: none; /* Safari支持 */
    -moz-user-select: none; /* Firefox支持 */
    -ms-user-select: none; /* IE支持 */
}
  
.quick-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(26, 115, 232, 0.1), transparent);
    transition: left 0.5s ease;
}

.quick-btn:hover::before {
    left: 100%;
}

.quick-btn:hover {
    background: #e3f2fd;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.2);
    border-color: #1a73e8;
}

.quick-btn span:first-child {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.quick-btn span:last-child {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
}

.usage-tips {
  border-top: 1px solid #e9ecef;
  padding-top: 15px;
}

.tips-label {
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
  font-size: 14px;
}

.tips-content p {
  margin: 6px 0;
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}

/* 加载覆盖层 */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-overlay p {
  color: #666;
  font-size: 14px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  min-height: 400px; /* 增加最小高度 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%; /* 确保宽度占满 */
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 16px;
  margin-bottom: 8px;
}

.empty-state-subtext {
  font-size: 14px;
  color: #888;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .list-layout {
    grid-template-columns: 250px 1fr 250px;
    gap: 15px;
    padding: 15px;
  }
  
  .list-controls {
    width: 250px;
  }
  
  .info-panel {
    width: 250px;
  }
  
  .list-container {
    min-width: 400px;
  }
  
  .station-list {
    min-width: 400px;
  }
}

@media (max-width: 992px) {
  .list-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }
  
  .list-controls, .info-panel {
    position: static;
    width: 100%;
  }
  
  .list-controls {
    order: 1;
  }
  
  .list-container {
    order: 2;
    min-width: 100%;
  }
  
  .info-panel {
    order: 3;
  }
  
  .station-list {
    max-height: 60vh;
    min-width: 100%;
  }
}

@media (max-width: 768px) {
  .list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .list-stats {
    flex-direction: column;
    gap: 5px;
  }
  
  .station-details {
    flex-direction: column;
    gap: 5px;
  }
  
  .filter-buttons, .sort-buttons, .sort-direction-buttons {
    justify-content: flex-start;
  }
  
  .station-thumbnail {
    width: 50px;
    height: 50px;
    margin-right: 12px;
  }
}

/* 滚动条样式 */
.station-list::-webkit-scrollbar {
  width: 6px;
}

.station-list::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.station-list::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.station-list::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
} 