/* ——— 时刻表添加弹窗（欢迎弹窗风格统一）——— */
.schedule-add-overlay {
  z-index: 1000;
}

.schedule-add-modal {
  background: var(--color-bg-surface);
  border-radius: var(--radius-xl);
  width: 460px;
  max-width: calc(100vw - 32px);
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-8) var(--space-6);
  position: relative;
  animation: welcomeSlideIn 0.3s ease;
}

.schedule-add-station-picks {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border-light);
}

.schedule-loading-modal {
  text-align: center;
  padding: 48px var(--space-6);
}

/* ——— Toast ——— */
.toast-msg {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-text-primary);
  color: var(--color-text-inverse);
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 2000;
  pointer-events: none;
}
.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive: narrow screens */
@media (max-width: 640px) {
  .upcoming-card-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .uc-countdown-text {
    align-self: flex-start;
  }
}

@media (max-width: 768px) {
  .welcome-guide-modal,
  .schedule-add-modal {
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 85vh;
  }
  @keyframes welcomeSlideIn {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
}

/* ——— 智能提醒 ——— */
.reminder-modal-overlay {
  z-index: 10000;
}
.reminder-modal {
  max-width: 420px;
  text-align: center;
  padding: 28px 24px 20px;
}
.reminder-modal-icon {
  margin-bottom: 12px;
}
.reminder-modal-title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
  margin-bottom: 8px;
}
.reminder-modal-body {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
}
.reminder-modal-trip {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--color-bg-app);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  font-size: var(--text-sm);
  transition: background 0.15s;
}
.reminder-modal-trip:hover {
  background: var(--color-bg-hover);
}
.reminder-trip-train {
  font-weight: var(--font-bold);
  color: var(--color-train);
}
.reminder-trip-route {
  color: var(--color-text-primary);
}
.reminder-trip-date {
  color: var(--color-text-tertiary);
  font-size: var(--text-xs);
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--color-border-light);
  border-radius: 24px;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--color-primary);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* Settings select */
.settings-select {
  padding: 6px 10px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-base);
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  cursor: pointer;
  outline: none;
}
.settings-select:focus {
  border-color: var(--color-primary);
}

/* ——— 测速 ——— */
.header-speedo-btn {
  display: none;
  align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--color-border-light); background: transparent;
  cursor: pointer; color: var(--color-text-secondary);
  transition: all 0.2s; margin-right: 4px;
}
.header-speedo-btn:hover { background: var(--color-bg-hover); color: var(--color-primary); }

@media (max-width: 768px) {
  .header-speedo-btn { display: flex; }
  .uc-speedo-btn { display: inline-flex; }
}

.speedo-page { min-height: calc(100vh - 120px); padding: 24px; }
.speedo-container { max-width: 700px; margin: 0 auto; }
.speedo-back { display: inline-flex; align-items: center; gap: 4px; background: none; border: none; color: var(--color-text-secondary); font-size: var(--text-sm); cursor: pointer; margin-bottom: 20px; }

/* 桌面端双栏布局 */
@media (min-width: 640px) {
  .speedo-main { display: flex; gap: 40px; align-items: flex-start; }
  .speedo-left { flex: 0 0 260px; text-align: center; }
  .speedo-right { flex: 1; min-width: 0; }
}

.speedo-dial { display: flex; justify-content: center; margin-bottom: 20px; }
.speedo-dial-ring { width: 200px; height: 200px; position: relative; }
.speedo-svg { width: 100%; height: 100%; color: var(--color-success); }
.speedo-dial-value { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.speedo-speed { font-size: 56px; font-weight: 800; line-height: 1; color: var(--color-success); font-family: var(--font-mono); }
.speedo-unit { font-size: 13px; color: var(--color-text-tertiary); margin-top: 4px; font-family: var(--font-mono); }
.speedo-near-limit .speedo-speed { color: var(--color-warning); }
.speedo-near-limit .speedo-svg { color: var(--color-warning); }
.speedo-over-limit .speedo-speed { color: #D14343; }
.speedo-over-limit .speedo-svg { color: #D14343; }

.speedo-limits { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.speedo-limit-btn { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--color-border-light); background: var(--color-bg-surface); color: var(--color-text-secondary); font-size: 13px; cursor: pointer; transition: all 0.15s; }
.speedo-limit-btn.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.speedo-limit-custom { display: flex; gap: 6px; justify-content: center; align-items: center; margin-bottom: 16px; padding: 6px 14px; border-radius: 20px; border: 1px solid var(--color-border-light); transition: all 0.15s; }
.speedo-limit-custom.active { border-color: var(--color-primary); }
.speedo-limit-input { width: 70px; padding: 0; border: none; background: transparent; color: var(--color-text-primary); font-size: 14px; text-align: center; outline: none; font-family: var(--font-mono); }
.speedo-limit-input:focus { color: var(--color-primary); }
.speedo-limit-unit { font-size: 12px; color: var(--color-text-tertiary); }

.speedo-center { text-align: center; margin-top: 20px; }
.speedo-start-btn { padding: 12px 48px; border-radius: 24px; border: none; background: var(--color-primary); color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; margin-bottom: 12px; transition: all 0.15s; }
.speedo-start-btn.active { background: var(--color-error); }
.speedo-error { font-size: 12px; color: var(--color-error); margin-bottom: 12px; text-align: center; }

.speedo-stations { text-align: left; }
.speedo-station { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--color-bg-app); border-radius: var(--radius-base); margin-bottom: 8px; font-size: var(--text-sm); }
.speedo-station-dir { font-size: 16px; color: var(--color-primary); width: 20px; text-align: center; }
.speedo-station-name { flex: 1; font-weight: var(--font-semibold); }
.speedo-station-dist { color: var(--color-text-tertiary); font-size: var(--text-xs); font-family: var(--font-mono); }

.speedo-stats { display: flex; justify-content: center; gap: 16px; margin-top: 8px; font-size: 12px; color: var(--color-text-tertiary); }
.speedo-right .speedo-stations { margin-top: 0; }

@media (max-width: 639px) {
  .speedo-right .speedo-stations { margin-top: 20px; }
}

/* 出行中卡片 测速按钮 */
.uc-speedo-btn { display: none; align-items: center; gap: 4px; margin-top: 8px; padding: 5px 14px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--color-success) 25%, transparent); background: color-mix(in srgb, var(--color-success) 6%, transparent); color: var(--color-success); font-size: 12px; cursor: pointer; z-index: 1; position: relative; }
.uc-speedo-btn:hover { background: color-mix(in srgb, var(--color-success) 12%, transparent); }

/* 暗色模式 */
[data-theme="dark"] .speedo-start-btn { background: var(--color-primary); }
[data-theme="dark"] .speedo-dial-ring .speedo-svg { color: var(--color-success); }
[data-theme="dark"] .speedo-dial-ring .speedo-speed { color: var(--color-success); }
[data-theme="dark"] .uc-speedo-btn { background: color-mix(in srgb, var(--color-success) 8%, transparent); border-color: color-mix(in srgb, var(--color-success) 20%, transparent); }
