/* ===================================
   小车运行线路参数配置 - 样式表
   =================================== */

/* CSS 变量定义 */
:root {
  /* 主色调 - 现代渐变蓝 */
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #e0e7ff;
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --primary-gradient-hover: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  
  /* 辅助色 */
  --success-color: #10b981;
  --success-hover: #059669;
  --success-light: #d1fae5;
  --warning-color: #f59e0b;
  --warning-light: #fef3c7;
  --danger-color: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: #fee2e2;
  
  /* 主题色 - 去程/返程/全程 */
  --forward-color: #3b82f6;
  --forward-light: #dbeafe;
  --forward-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --return-color: #8b5cf6;
  --return-light: #ede9fe;
  --return-gradient: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  --total-color: #f59e0b;
  --total-light: #fef3c7;
  --total-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  
  /* 中性色 */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  
  /* 功能色 */
  --background: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  /* 阴影 - 更柔和的层次 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
  --shadow-glow-success: 0 0 20px rgba(16, 185, 129, 0.15);
  
  /* 圆角 */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;
  
  /* 过渡 */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 页面加载动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden;
}

/* 应用容器 */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ===================================
   顶部导航栏
   =================================== */
.header {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-md);
  z-index: 100;
  animation: fadeInUp 0.5s ease-out;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.app-title {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-title .icon {
  font-size: 1.75rem;
  -webkit-text-fill-color: initial;
  filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.3));
}

.app-title .icon {
  font-size: 1.75rem;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
}

/* ===================================
   按钮样式
   =================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn .icon {
  font-size: 1rem;
  transition: var(--transition-fast);
}

.btn:hover .icon {
  transform: scale(1.1);
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  background: var(--primary-gradient-hover);
  box-shadow: 0 6px 8px -1px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
  background: var(--gray-200);
  border-color: var(--gray-300);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  box-shadow: 0 6px 8px -1px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  box-shadow: 0 6px 8px -1px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--gray-300);
  color: var(--gray-700);
}

.btn-outline:hover {
  background: var(--gray-50);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===================================
   主内容区域
   =================================== */
.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* 侧边栏 */
.sidebar {
  width: 300px;
  min-width: 280px;
  max-width: 350px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 1.5rem;
  flex-shrink: 0;
}

.right-sidebar {
  width: 700px;
  min-width: 650px;
  max-width: 900px;
  border-right: none;
  border-left: 1px solid var(--border);
  flex-shrink: 0;
}

/* 内容区域 */
.content-area {
  flex: 1;
  min-width: 0; /* 允许 flex 子项缩小 */
  background: var(--background);
  padding: 1.5rem;
  overflow-y: auto;
}

/* ===================================
   面板样式
   =================================== */
.panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.panel:hover {
  box-shadow: var(--shadow-lg);
}

.panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.panel-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-body {
  padding: 1.5rem;
}

.panel-info {
  background: linear-gradient(135deg, var(--primary-light) 0%, #e0e7ff 100%);
  border: 1px solid var(--primary-color);
}

.info-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.info-list {
  list-style: none;
  padding-left: 0;
}

.info-list li {
  font-size: 0.8125rem;
  color: var(--gray-700);
  padding: 0.375rem 0;
  line-height: 1.5;
}

/* 参数说明样式 */
.param-desc-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-bottom: 0.625rem;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.param-desc-item:last-child {
  margin-bottom: 0;
}

.param-desc-num {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  margin-top: 0.0625rem;
}

.param-desc-text {
  color: var(--gray-700);
  flex: 1;
}

.param-desc-text strong {
  color: var(--primary-color);
  font-weight: 600;
}

/* ===================================
   表单样式
   =================================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

.label-text {
  flex: 1;
}

.label-info {
  cursor: help;
  opacity: 0.6;
  transition: var(--transition);
}

.label-info:hover {
  opacity: 1;
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  color: var(--text-primary);
  transition: var(--transition);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light), inset 0 1px 2px rgba(0, 0, 0, 0.05);
  background: white;
}

.form-input:hover:not(:focus) {
  border-color: var(--gray-400);
  background: white;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 1.5rem 0;
}

.form-hint {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: var(--gray-500);
}

.button-group {
  margin-top: 1.5rem;
}

/* ===================================
   路段列表
   =================================== */
.segment-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: calc(100vh - 400px);
  overflow-y: auto;
}

.segment-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  transition: var(--transition);
  cursor: grab;
}

.segment-item:hover {
  background: white;
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.segment-item.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

/* Alt+拖拽复制模式 */
.segment-item.copying {
  opacity: 0.7;
  cursor: copy;
  border-style: dashed;
  border-color: var(--success-color);
  background: var(--success-light);
}

/* 拖拽目标高亮 */
.segment-item.drag-target {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
  transform: scale(1.02);
}

/* 复制目标高亮 */
.segment-item.copy-target {
  border-color: var(--success-color);
  box-shadow: 0 0 0 3px var(--success-light);
  background: var(--success-light);
  transform: scale(1.02);
}

/* Alt 键按下时的全局提示 */
body.alt-pressed .segment-item {
  cursor: copy;
}

body.alt-pressed .segment-item:hover {
  border-color: var(--success-color);
}

/* 拖拽提示文字 */
.drag-hint {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  border: 1px dashed var(--gray-300);
}

.drag-hint .hint-section {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--gray-200);
}

.drag-hint .hint-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.drag-hint .hint-title {
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.375rem;
  font-size: 0.8125rem;
}

.drag-hint .hint-item {
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 0.5rem;
}

.drag-hint .hint-item:last-child {
  margin-bottom: 0;
}

/* 行内样式 - 不分左右布局 */
.drag-hint .hint-item-inline {
  margin-bottom: 0.375rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--gray-600);
}

.drag-hint .hint-item-inline:last-child {
  margin-bottom: 0;
}

.drag-hint .hint-item-inline strong {
  color: var(--gray-800);
  font-weight: 600;
}

.drag-hint kbd {
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  padding: 0.125rem 0.375rem;
  font-family: monospace;
  font-size: 0.6875rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.segment-drag-handle {
  cursor: grab;
  opacity: 0.5;
  transition: var(--transition);
  font-size: 1.25rem;
}

.segment-drag-handle:hover {
  opacity: 1;
}

.segment-item:hover .segment-drag-handle {
  opacity: 1;
}

.segment-info {
  flex: 1;
  min-width: 0;
}

.segment-name {
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.segment-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.segment-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.segment-actions {
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  transition: var(--transition);
}

.segment-item:hover .segment-actions {
  opacity: 1;
}

.segment-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: var(--gray-200);
  color: var(--gray-700);
}

.segment-type-badge.line {
  background: #dbeafe;
  color: #1e40af;
}

.segment-type-badge.arc {
  background: #fce7f3;
  color: #9d174d;
}

.segment-color-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
}

.segment-color-badge.white {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid var(--gray-300);
}

.segment-color-badge.green {
  background: #d1fae5;
  color: #065f46;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--gray-500);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--gray-600);
}

.empty-state p {
  font-size: 0.875rem;
}

/* 路段统计 */
.segment-stats {
  display: flex;
  gap: 1.5rem;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  margin-top: 1rem;
}

/* 路线配置示意图 */
.route-diagram {
  margin-top: 1.5rem;
  padding: 1rem;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  position: relative;
}

.route-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  justify-content: center;
}

.route-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--gray-300);
  background: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.route-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.route-btn:active {
  transform: translateY(0);
}

.route-hint {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--gray-500);
  text-align: center;
}

.diagram-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0 0 0.75rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.route-canvas {
  width: 100%;
  height: 200px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  display: block;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* ===================================
   计算结果区域
   =================================== */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  min-width: 0; /* 允许缩小 */
}

.summary-icon {
  font-size: 2rem;
}

.summary-content {
  flex: 1;
  min-width: 0;
}

.summary-label {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-bottom: 0.25rem;
}

.summary-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 图表容器 */
.chart-container {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  width: 100%;
}

.chart-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 1rem;
}

.speed-chart {
  width: 100%;
  height: 300px;
  background: white;
  border-radius: var(--radius-sm);
  display: block;
  position: relative;
  z-index: 1;
}

/* 数据表格 */
.data-table-container {
  margin-top: 1.5rem;
}

/* 验算区域 */
.verification-section {
  margin: 1.5rem 0;
  padding: 1rem;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 2px solid #10b981;
  border-radius: var(--radius-md);
}

.verification-section .button-row {
  display: flex;
  gap: 0.75rem;
}

.verification-section .button-row .btn {
  flex: 1;
}

.verification-hint {
  font-size: 0.8125rem;
  color: var(--gray-600);
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.verification-result {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
}

.verification-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.verification-title .icon {
  font-size: 1.25rem;
}

.verification-content {
  display: grid;
  gap: 0.75rem;
}

.verification-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem;
  background: white;
  border-radius: var(--radius-sm);
}

.verification-label {
  font-size: 0.8125rem;
  color: var(--gray-700);
  font-weight: 500;
}

.verification-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary-color);
}

.verification-status {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  text-align: center;
  font-weight: 600;
}

.verification-status.success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #10b981;
}

.verification-status.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #ef4444;
}

.verification-status.warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
}

/* 验算详细信息样式 */
.verification-details {
  margin-top: 1rem;
  padding: 1rem;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}

.verification-details-content h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-800);
  margin: 1rem 0 0.5rem 0;
}

.verification-details-content h4:first-child {
  margin-top: 0;
}

.verification-details-content p {
  font-size: 0.8125rem;
  color: var(--gray-700);
  margin: 0.5rem 0;
  line-height: 1.6;
}

.segment-verification-table {
  margin: 0.75rem 0;
  overflow-x: auto;
}

.segment-verification-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.segment-verification-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  background: var(--gray-50);
  color: var(--gray-700);
  font-weight: 600;
  border-bottom: 2px solid var(--gray-200);
}

.segment-verification-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-600);
}

.segment-verification-table tr:hover {
  background: var(--gray-50);
}

.segment-verification-table tr:last-child td {
  border-bottom: none;
}

.table-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.75rem;
}

.table-wrapper {
  max-height: 400px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.data-table thead {
  position: sticky;
  top: 0;
  background: var(--gray-100);
  z-index: 1;
}

.data-table th {
  padding: 0.625rem 0.5rem;
  text-align: left;
  font-weight: 600;
  color: var(--gray-700);
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
  font-size: 0.75rem;
}

.data-table td {
  padding: 0.625rem 0.5rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-600);
  font-size: 0.75rem;
  white-space: nowrap; /* 不换行，完整显示内容 */
}

.data-table tbody tr:hover {
  background: var(--gray-50);
}

.data-table .empty-message {
  text-align: center;
  color: var(--gray-400);
  padding: 2rem;
}

/* ===================================
   模态框
   =================================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  width: 90%;
  max-width: 500px;
  z-index: 1001;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-800);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--gray-600);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ===================================
   提示消息
   =================================== */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary-color);
  animation: toastSlideIn 0.3s ease;
  min-width: 300px;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.success {
  border-left-color: var(--success-color);
}

.toast.error {
  border-left-color: var(--danger-color);
}

.toast.warning {
  border-left-color: var(--warning-color);
}

.toast-icon {
  font-size: 1.25rem;
}

.toast-message {
  flex: 1;
  font-size: 0.875rem;
  color: var(--gray-700);
}

/* ===================================
   滚动条样式
   =================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ===================================
   响应式设计
   =================================== */
@media (max-width: 1400px) {
  .left-sidebar {
    width: 280px;
  }
  
  .right-sidebar {
    width: 400px;
  }
  
  .summary-cards {
    grid-template-columns: 1fr;
  }
}

/* 窄屏幕：单列堆叠布局 */
@media (max-width: 1500px) {
  .main-content {
    flex-direction: column;
    overflow-y: auto;
  }
  
  /* 所有侧边栏变成全宽 */
  .sidebar,
  .right-sidebar {
    width: 100%;
    min-width: auto;
    max-width: none;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 1rem;
  }
  
  .right-sidebar {
    border-left: none;
  }
  
  /* 内容区域也全宽 */
  .content-area {
    width: 100%;
    min-width: auto;
    padding: 1rem;
    overflow: visible;
  }
  
  /* 路段列表高度自适应 */
  .segment-list {
    max-height: none;
  }
  
  /* 结果卡片减少列数 */
  .summary-cards.compact {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .route-result-section.total .summary-cards.compact {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 移动端优化 */
@media (max-width: 640px) {
  /* 头部简化 */
  .header {
    padding: 0.75rem 1rem;
  }
  
  .app-title {
    font-size: 1.125rem;
  }
  
  .header-actions {
    gap: 0.5rem;
  }
  
  .header-actions .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }
  
  .header-actions .btn .icon {
    margin-right: 0;
  }
  
  .header-actions .btn span:not(.icon) {
    display: none;
  }
  
  /* 面板减少内边距 */
  .panel {
    margin-bottom: 1rem;
  }
  
  .panel-header {
    padding: 1rem;
  }
  
  .panel-body {
    padding: 1rem;
  }
  
  /* 结果卡片进一步减少 */
  .summary-cards.compact {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .route-result-section.total .summary-cards.compact {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* 路段项简化 */
  .segment-item {
    padding: 0.75rem;
  }
  
  .segment-meta {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  /* 按钮组垂直排列 */
  .panel-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .panel-actions .btn {
    width: 100%;
  }
  
  /* 路线切换器优化 */
  .route-switcher {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .route-tabs {
    width: 100%;
  }
  
  .route-tab {
    flex: 1;
    justify-content: center;
  }
}

/* ===================================
   工具类
   =================================== */
.text-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ===================================
   线路切换器
   =================================== */
.route-switcher {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.route-tabs {
  display: flex;
  gap: 0.5rem;
  flex: 1;
}

.route-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--gray-100);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
}

.route-tab:hover {
  background: var(--gray-200);
}

.route-tab.active {
  background: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.route-tab .route-icon {
  font-size: 1rem;
}

.route-tab .route-name {
  white-space: nowrap;
}

/* 返程线路特殊样式 */
.route-tab.return-route {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.route-tab.return-route:hover {
  background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
}

.route-tab.return-route.active {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
}

.route-badge {
  background: #10b981;
  color: white;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 9999px;
  margin-left: 0.25rem;
}

.route-tab.return-route .route-badge {
  background: #f59e0b;
}

/* 返程路段列表样式 */
.segment-item.return-segment {
  border-left: 3px solid #f59e0b;
}

.segment-return-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  margin-left: 0.5rem;
}

.param-original {
  font-size: 0.75rem;
  color: var(--gray-400);
  text-decoration: line-through;
  margin-left: 0.25rem;
}

.param-value.highlight {
  color: #059669;
  font-weight: 600;
}

/* 预览信息样式 */
.preview-info {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}

.preview-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.75rem;
}

.preview-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.preview-list li {
  font-size: 0.875rem;
  color: var(--gray-600);
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.preview-list li:last-child {
  border-bottom: none;
}

.preview-list span {
  font-weight: 600;
  color: var(--gray-800);
}

/* 路线警告提示 */
.route-warning {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.route-warning .warning-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.route-warning .warning-content {
  flex: 1;
}

.route-warning .warning-content strong {
  display: block;
  color: #92400e;
  font-weight: 600;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

.route-warning .warning-content p {
  color: #a16207;
  font-size: 0.8125rem;
  line-height: 1.5;
  margin: 0;
}

/* 保存提醒横幅 */
.save-warning-banner {
  margin: 1rem 0;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border: 2px solid #f87171;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.1), 0 2px 4px -1px rgba(239, 68, 68, 0.06);
}

.save-warning-banner .save-warning-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.save-warning-banner .save-warning-content {
  flex: 1;
}

.save-warning-banner .save-warning-content strong {
  display: block;
  color: #991b1b;
  font-weight: 700;
  margin-bottom: 0.375rem;
  font-size: 1rem;
}

.save-warning-banner .save-warning-content p {
  color: #7f1d1d;
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0;
}

.save-warning-banner .highlight-danger {
  color: #dc2626;
  font-weight: 700;
  background: #fef2f2;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  border: 1px solid #fecaca;
}

/* ===================================
   多线路结果展示
   =================================== */
.multi-route-results {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* 去程结果 - 蓝色主题 */
.route-result-section.forward {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.route-result-section.forward .route-result-title {
  color: var(--forward-color);
}

/* 返程结果 - 紫色主题 */
.route-result-section.return {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border: 1px solid #ddd6fe;
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(139, 92, 246, 0.1);
}

.route-result-section.return .route-result-title {
  color: var(--return-color);
}

/* 全程结果 - 橙色主题 */
.route-result-section.total {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.1);
}

.route-result-section.total .route-result-title {
  color: var(--total-color);
}

.route-result-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.route-result-title .route-icon {
  font-size: 1.125rem;
}

.summary-cards.compact {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.route-result-section.total .summary-cards.compact {
  grid-template-columns: repeat(4, 1fr);
}

.summary-cards.compact .summary-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.75rem 0.5rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.5);
  gap: 0.25rem;
  transition: var(--transition);
  backdrop-filter: blur(4px);
}

.summary-cards.compact .summary-card:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* 去程卡片高亮 */
.route-result-section.forward .summary-cards.compact .summary-card.highlight {
  background: white;
  border-color: var(--forward-color);
  box-shadow: 0 0 0 2px var(--forward-color), 0 4px 6px rgba(59, 130, 246, 0.15);
}

.route-result-section.forward .summary-cards.compact .summary-card.highlight .summary-value {
  color: var(--forward-color);
}

/* 返程卡片高亮 */
.route-result-section.return .summary-cards.compact .summary-card.highlight {
  background: white;
  border-color: var(--return-color);
  box-shadow: 0 0 0 2px var(--return-color), 0 4px 6px rgba(139, 92, 246, 0.15);
}

.route-result-section.return .summary-cards.compact .summary-card.highlight .summary-value {
  color: var(--return-color);
}

/* 全程卡片高亮 */
.route-result-section.total .summary-cards.compact .summary-card.highlight {
  background: white;
  border-color: var(--total-color);
  box-shadow: 0 0 0 2px var(--total-color), 0 4px 6px rgba(245, 158, 11, 0.15);
}

.route-result-section.total .summary-cards.compact .summary-card.highlight .summary-value {
  color: var(--total-color);
}

.summary-cards.compact .summary-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
  transition: var(--transition-fast);
}

.summary-cards.compact .summary-card:hover .summary-icon {
  transform: scale(1.15);
}

.summary-cards.compact .summary-content {
  width: 100%;
}

.summary-cards.compact .summary-label {
  font-size: 0.6875rem;
  color: var(--gray-500);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.summary-cards.compact .summary-value {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

/* 响应式：小屏幕时减少列数 */
@media (max-width: 1400px) {
  .summary-cards.compact {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .route-result-section.total .summary-cards.compact {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===================================
   速度增量设置区域
   =================================== */
.speed-increment-section {
  margin-bottom: 1rem;
}

.speed-increment-section .form-hint {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--gray-500);
  font-size: 0.8125rem;
}

.increment-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.increment-item {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}

.increment-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-700);
}

.increment-input {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.9375rem;
  text-align: center;
}

.color-badge {
  font-size: 0.875rem;
}

.type-badge {
  font-size: 0.75rem;
  padding: 0.125rem 0.375rem;
  background: var(--gray-200);
  border-radius: var(--radius-sm);
  color: var(--gray-600);
}

/* 预览信息中的速度项 */
.preview-speed-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.preview-type {
  font-weight: 500;
  color: var(--gray-700);
  min-width: 100px;
}
