/* 标签页导航 */
.tabs {
  display: flex;
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.tabs::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

.tab {
  flex: 1;
  min-width: 0;
  padding: 16px 12px;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.tab.active {
  color: var(--primary-light);
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--primary-light);
  border-radius: 3px 3px 0 0;
}

/* 标签页内容 */
.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 设置面板 */
.settings-panel {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.setting-item {
  margin-bottom: 24px;
  padding: 16px;
  background: var(--surface-color);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.setting-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

.setting-input {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition);
}

.setting-input:focus {
  outline: none;
  border-color: var(--primary-light);
  background: rgba(255, 255, 255, 0.15);
}

.setting-input[type="number"] {
  -moz-appearance: textfield;
}

.setting-input[type="number"]::-webkit-outer-spin-button,
.setting-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.setting-checkbox {
  margin-right: 8px;
  transform: scale(1.2);
}

.setting-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 5px;
  line-height: 1.4;
}

/* 历史记录面板 */
.history-panel {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.history-item {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 16px;
  margin-bottom: 12px;
  transition: var(--transition);
  cursor: pointer;
}

.history-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--primary-light);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.history-date {
  font-weight: 600;
  color: var(--text-primary);
}

.history-duration {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.history-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.history-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.stat-value {
  color: var(--primary-light);
  font-weight: 600;
}

.history-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-sm:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* 轨迹信息 */
.track-info {
  padding: 20px;
  background: var(--surface-color);
  margin: 20px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.track-info h3 {
  margin-bottom: 16px;
  color: var(--text-primary);
}

.track-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.track-stats div {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.track-stats div:last-child {
  border-bottom: none;
}

.export-options {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 20px;
  flex-wrap: wrap;
}

.export-btn {
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
}

.export-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary-light);
  color: var(--primary-light);
}

/* 图表容器 */
.chart-container {
  position: relative;
  height: 300px;
  margin: 20px;
  background: var(--surface-color);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .tabs {
    font-size: 0.8rem;
  }
  
  .tab {
    padding: 12px 8px;
  }
  
  .settings-panel,
  .history-panel {
    padding: 12px;
    max-height: 50vh;
  }
  
  .setting-item {
    padding: 12px;
    margin-bottom: 16px;
  }
  
  .history-stats {
    grid-template-columns: 1fr;
  }
  
  .track-stats {
    grid-template-columns: 1fr;
  }
  
  .chart-container {
    height: 250px;
    margin: 12px;
    padding: 12px;
  }
  
  .export-options {
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .tab {
    padding: 10px 6px;
    font-size: 0.75rem;
  }
  
  .history-item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .history-actions {
    justify-content: flex-start;
  }
}

/* 深色模式优化 */
[data-theme="light"] .tab {
  color: var(--text-secondary);
}

[data-theme="light"] .tab:hover {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .setting-input {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .history-item:hover,
[data-theme="light"] .setting-item {
  background: #f8f9fa;
}