.ocr-preview-card .ticket-time input,
.ocr-preview-card .train-number input {
  font-family: inherit;
  font-size: inherit;
  padding: 2px 6px;
  border: 2px solid var(--primary);
  border-radius: var(--radius-xs);
  outline: none;
  background: var(--card-background);
  color: var(--text-primary);
  width: auto;
  min-width: 80px;
}

.ocr-preview-card .header-right .preview-field {
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  transition: background 0.15s;
}
.ocr-preview-card .header-right .preview-field:hover {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}
.loading-spinner-inline {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top: 2px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

/* ==================== 时刻表面�?? ==================== */
.schedule-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.schedule-btn:hover:not(:disabled) {
  background: var(--primary);
  color: white;
}
.schedule-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.schedule-panel {
  background: var(--card-background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  max-height: 360px;
  overflow-y: auto;
}
.schedule-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.schedule-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 15px;
}
.schedule-date {
  font-size: 13px;
  color: var(--text-secondary);
}

.schedule-table {
  display: flex;
  flex-direction: column;
}
.schedule-row-header {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  background: var(--background-light);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}
.schedule-row {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-base);
  cursor: pointer;
  transition: all 0.15s;
  border: 2px solid transparent;
}
.schedule-row:hover {
  background: var(--primary-light);
}
.schedule-row-selected {
  background: var(--primary-light) !important;
  border-color: var(--primary) !important;
}

.col-no { width: 32px; text-align: center; flex-shrink: 0; font-size: 14px; color: var(--text-secondary); }
.col-station { flex: 1; font-size: 14px; font-weight: 500; color: var(--text-primary); padding: 0 8px; }
.col-time { width: 60px; text-align: center; flex-shrink: 0; font-size: 14px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.col-stop { width: 50px; text-align: center; flex-shrink: 0; font-size: 14px; color: var(--text-secondary); }
.col-stopover { width: 52px; text-align: center; flex-shrink: 0; font-size: 14px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.schedule-hint {
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--color-warning-bg);
  border-radius: var(--radius-base);
  font-size: 12px;
  color: var(--color-warning);
  text-align: center;
}

.schedule-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* 深色模式时刻�?? */
[data-theme= dark] .schedule-panel {
  background: var(--card-background);
  border-color: var(--border);
}
[data-theme=dark] .schedule-row-header {
  background: rgba(255,255,255,0.05);
}
[data-theme=dark] .schedule-row:hover {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}
[data-theme=dark] .schedule-row-selected {
  background: color-mix(in srgb, var(--primary) 12%, transparent) !important;
  border-color: var(--primary) !important;
}
[data-theme=dark] .schedule-hint {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
}
[data-theme=dark] .schedule-btn {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}/* ==================== OCR编辑表单 ==================== */
.ocr-result-section {
  margin-top: 20px;
}
.ocr-result-section .preview-hint {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 12px;
}
.ocr-preview-card {
  margin-bottom: 24px;
}
.ocr-edit-form {
  background: var(--card-background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}
.ocr-edit-form h4 {
  margin: 0 0 16px 0;
  color: var(--text-primary);
  font-size: 15px;
}
.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.form-row .form-group {
  flex: 1;
  min-width: 0;
}
@media (max-width: 600px) {
  .ocr-edit-form {
    padding: 16px;
  }
  .ocr-edit-form h4 {
    margin-bottom: 12px;
  }
  .form-row {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
  }
  .form-row .form-group {
    width: 100%;
  }
}
/* ==================== 详情面板内时刻表（Grid 布局，与添加页 Flex 版隔离） ==================== */
.detail-panel .schedule-table-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.detail-panel .schedule-table {
  min-width: 100%;
  width: max-content;
  display: block;
  background: var(--color-bg-hover);
  border-radius: var(--radius-base);
}

.detail-panel .schedule-header {
  display: grid;
  grid-template-columns: 28px 1fr 84px 84px 48px 56px;
  padding: 10px 12px;
  margin: 0;
  background: var(--color-bg-hover);
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 400;
  border-bottom: 1px solid var(--border);
  gap: 0;
  align-items: center;
  justify-content: start;
}

.detail-panel .schedule-header.editing {
  grid-template-columns: 28px 1fr 84px 84px 48px 52px 48px 36px;
}

.detail-panel .schedule-body {
  display: block;
  padding: 0;
  overflow-y: visible;
}

.detail-panel .schedule-row {
  display: grid;
  grid-template-columns: 28px 1fr 84px 84px 48px 56px;
  gap: 0;
  padding: 0 12px;
  align-items: center;
  min-height: 48px;
  border: none;
  border-radius: 0;
  cursor: default;
  border-bottom: 1px solid var(--color-border-light);
  transition: background 0.15s;
}

.detail-panel .schedule-row.editing {
  grid-template-columns: 28px 1fr 84px 84px 48px 52px 48px 36px;
}

.detail-panel .schedule-row:last-child {
  border-bottom: none;
}

.detail-panel .schedule-row:hover {
  background: rgba(0,0,0,0.025);
}

.detail-panel .schedule-row.editing {
  background: color-mix(in srgb, var(--primary) 5%, transparent);
}

.detail-panel .schedule-row.editing:hover {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.detail-panel .schedule-row.in-journey {
  /* no background highlight */
}

.detail-panel .schedule-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.detail-panel .col-line {
  min-width: 0;
}

.line-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  border: 2px solid var(--background-light);
}

.line-dot.active {
  background: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent);
}

.line-connector {
  flex: 1;
  width: 2px;
  background: var(--border);
  margin: 3px 0;
}

.line-connector.active {
  background: var(--primary);
}

.detail-panel .col-station {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.station-name {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  text-align: left;
  word-break: keep-all;
}

.journey-start .station-name,
.journey-end .station-name {
  font-weight: 700;
}

.station-tag {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
}

.station-tag.start {
  background: var(--success-light);
  color: var(--success);
}

.station-tag.end {
  background: var(--primary-light);
  color: var(--primary);
}

.detail-panel .col-time {
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  min-width: 0;
}

.detail-panel .col-duration {
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  min-width: 0;
}

.detail-panel .col-status {
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-panel .col-delay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  min-width: 0;
}

.detail-panel .col-uncertain {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  min-width: 0;
}

.status-on-time {
  color: var(--color-info);
}

.status-delayed {
  color: var(--error);
}

.status-early {
  color: var(--success);
}

.status-unknown {
  color: var(--text-secondary);
}

.time-input, .duration-input, .status-select {
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-background);
  color: var(--text-primary);
}

[data-theme="dark"] .time-input,
[data-theme="dark"] .duration-input,
[data-theme="dark"] .status-select {
  background: var(--card-background);
  color: var(--text-primary);
  color-scheme: dark;
}

[data-theme="dark"] .status-select option {
  background: var(--card-background);
  color: var(--text-primary);
}

/* 时刻表折叠行 */
.schedule-collapse-row {
  cursor: pointer !important;
  background: color-mix(in srgb, var(--primary) 4%, transparent) !important;
  min-height: 36px !important;
  transition: background 0.15s;
}
.schedule-collapse-row:hover {
  background: color-mix(in srgb, var(--primary) 8%, transparent) !important;
}
.collapse-dot {
  width: 6px !important;
  height: 6px !important;
  background: var(--primary) !important;
  border: none !important;
  box-shadow: none !important;
}
.collapse-label {
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  gap: 6px;
  white-space: nowrap;
  overflow: visible;
  flex: none;
}
.collapse-arrow {
  display: inline-block;
  font-size: 10px;
  transition: transform 0.2s;
}

/* 时间列中的站点标签（始发站/终到站） */
.station-tag-col {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-weight: 500;
  white-space: nowrap;
}
.station-tag-col.start {
  background: var(--success-light);
  color: var(--success);
}
.station-tag-col.end {
  background: transparent;
  color: var(--primary);
}

/* 页面切换动画 */
.page-enter {
  animation: pageEnter 0.3s ease forwards;
}

.page-leave {
  animation: pageLeave 0.3s ease forwards;
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pageLeave {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* 页面内容淡入 */
.page-content {
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tab切换滑动指示器 */
.tab-slider {
  position: absolute;
  bottom: 0;
  height: 100%;
  border-radius: var(--radius-lg);
  background: var(--color-bg-surface);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .tab-slider {
  background: var(--card-background);
}

/* 搜索栏和列表页过渡 */
.search-bar,
.ticket-list {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* 设置页面过渡 */
.settings-page {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Vue 页面过渡 — 淡入 + 轻微上移，更流畅 */
.page-fade-enter-active {
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.page-fade-leave-active {
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-fade-enter-from {
  opacity: 0;
  transform: translateY(12px);
}
.page-fade-leave-to {
  opacity: 0;
  transform: translateY(-8px);
}

.page-fade-enter-to,
.page-fade-leave-from {
  opacity: 1;
  transform: translateY(0);
}

.status-select {
  min-width: 70px;
}

.schedule-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  gap: 8px;
}

.schedule-empty {
  padding: 16px;
  text-align: center;
}

/* 时刻表录入弹窗 */
.schedule-entry-modal {
  max-width: 450px;
}

.schedule-entry-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.schedule-entry-button {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card-background);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-primary);
  width: 100%;
  text-align: left;
}

.schedule-entry-button:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.schedule-entry-button svg {
  flex-shrink: 0;
}

.schedule-entry-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.schedule-entry-label {
  font-size: 15px;
  font-weight: 600;
}

.schedule-entry-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 时刻表OCR弹窗 */
.schedule-ocr-modal {
  max-width: 520px;
}

.ocr-upload-zone {
  min-height: 130px;
  padding: 24px 20px;
}

.ocr-results-preview {
  background: rgba(0,0,0,0.025);
  border-radius: var(--radius-base);
  padding: 12px;
  margin-bottom: 12px;
}

.ocr-results-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.ocr-results-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 240px;
  overflow-y: auto;
}

.ocr-result-item {
  display: grid;
  grid-template-columns: 28px 1fr 56px 56px 24px;
  gap: 6px;
  align-items: center;
  padding: 5px 8px;
  background: var(--color-bg-surface);
  border-radius: var(--radius-xs);
  font-size: 13px;
}

.ocr-result-seq {
  color: var(--text-secondary);
  font-size: 11px;
  text-align: center;
}

.ocr-result-name {
  font-weight: 500;
  color: var(--text-primary);
}

.ocr-result-time {
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
}

.ocr-result-remove {
  background: none;
  border: none;
  padding: 3px;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ocr-result-remove:hover {
  color: var(--error);
  background: rgba(0,0,0,0.05);
}

.uploaded-image {
  max-width: 100%;
  max-height: 360px;
  border-radius: var(--radius-base);
  object-fit: contain;
  display: block;
}

/* 时刻表手动录入弹窗 */
.schedule-manual-modal {
  max-width: 780px;
  max-height: 80vh;
}

.schedule-manual-content {
  margin-bottom: 16px;
}

.schedule-manual-table {
  overflow-x: auto;
  overscroll-behavior: contain;
}

.schedule-manual-header {
  min-width: 570px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 30px 110px 98px 98px 52px 64px 48px 40px 30px;
  gap: 8px;
  padding: 12px 8px;
  background: rgba(0,0,0,0.03);
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.schedule-manual-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: clip;
  overscroll-behavior: contain;
}

.schedule-manual-row {
  min-width: 570px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 30px 110px 98px 98px 52px 64px 48px 40px 30px;
  gap: 8px;
  align-items: center;
  position: relative;
  transition: all 0.2s ease;
}

.schedule-manual-row:hover {
  background-color: color-mix(in srgb, var(--primary) 5%, transparent);
}

.schedule-manual-row.dragging {
  opacity: 0.5;
}

.schedule-manual-row.drag-over {
  border-top: 2px dashed var(--primary);
}

.drag-preview {
  position: absolute;
  left: 0;
  right: 0;
  top: -8px;
  height: 4px;
  background: var(--primary);
  border-radius: var(--radius-xs);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drag-preview-bottom {
  top: auto;
  bottom: -8px;
}

.drag-preview span {
  background: var(--primary);
  color: white;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  margin-top: -20px;
  white-space: nowrap;
}

.drag-handle {
  background: none;
  border: none;
  cursor: grab;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.drag-handle:hover {
  color: var(--primary);
}

.drag-handle:active {
  cursor: grabbing;
}

.schedule-manual-header {
  min-width: 570px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 30px 110px 98px 98px 52px 64px 48px 40px 30px;
  gap: 8px;
  align-items: center;
}

.station-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  box-sizing: border-box;
  background: var(--card-background);
  color: var(--text-primary);
}

[data-theme="dark"] .station-input {
  background: var(--card-background);
  color: var(--text-primary);
}

.schedule-manual-row .time-input {
  width: 100%;
  height: 36px;
  padding: 4px 6px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  box-sizing: border-box;
}

.schedule-manual-row .duration-input {
  width: 100%;
  padding: 8px 6px;
  font-size: 14px;
  text-align: center;
  box-sizing: border-box;
}

.schedule-manual-row .status-select {
  width: 100%;
  padding: 8px 2px;
  font-size: 14px;
  box-sizing: border-box;
}

.schedule-manual-row .delay-input {
  width: 100%;
  padding: 6px 4px;
  font-size: 14px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  -moz-appearance: textfield;
}

.schedule-manual-row .delay-input::-webkit-outer-spin-button,
.schedule-manual-row .delay-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.delay-placeholder {
  display: block;
  width: 100%;
}

.uncertain-check {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.uncertain-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}
