/* ==================== 空搜索状态 ==================== */
.empty-search-state {
  text-align: center;
  padding: 64px 20px;
}
.empty-search-icon {
  font-size: 52px;
  margin-bottom: 16px;
}
.empty-search-title {
  font-size: 17px;
  font-weight: 650;
  color: var(--text-primary);
  margin: 0 0 16px;
}
.empty-search-tips {
  text-align: left;
  max-width: 300px;
  margin: 0 auto 24px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.9;
}
.empty-search-tips p { margin: 0 0 4px; font-weight: 600; }
.empty-search-tips ul { margin: 0; padding-left: 18px; }
.empty-search-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.empty-search-actions button {
  padding: 10px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-ui);
  background: var(--background-light);
  border: 1.5px solid var(--border);
  color: var(--text-primary);
  transition: all 0.2s;
}
.empty-search-actions button:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 4%, transparent);
}

/* ==================== 移动端 ==================== */
@media (max-width: 768px) {
  .filter-modal-overlay { padding: 0; align-items: flex-end; }
  .filter-modal { width: 100%; max-height: 80vh; border-radius: 20px 20px 0 0; }
  .filter-modal-header { padding: 16px 20px 12px; }
  .filter-modal-body { padding: 4px 20px 8px; }
  .filter-modal-footer { padding: 12px 20px 16px; }
  .filter-toggle-btn span { display: none; }
  .status-tabs { display: none; }
  .filter-status-section { display: block; }
  .sort-select { font-size: 12px; padding: 6px 10px; }
  .filter-summary { padding: 6px 12px; }
  .search-result-bar { padding: 0 12px; }
  .stat-tab-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
  }
  .stat-tab-nav::-webkit-scrollbar { display: none; }
}

/* 出行洞察Tab样式 */
.stat-tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--background-light);
  padding: 4px;
  border-radius: var(--radius-xl);
  width: fit-content;
}

.stat-tab-btn {
  padding: 6px 18px;
  border: none;
  border-radius: var(--radius-xl);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.stat-tab-btn:hover {
  background: var(--color-bg-hover);
  color: var(--text-primary);
}

.stat-tab-btn.active {
  background: var(--card-background);
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

.insight-section {
  margin-bottom: 24px;
}

.insight-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.insight-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-secondary);
  font-size: 14px;
}

.insight-empty small {
  display: block;
  margin-top: 6px;
  font-size: 12px;
}

/* 出行画像 */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 480px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

.profile-card {
  background: var(--card-background);
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  padding: 12px;
}

.profile-card h4 {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-weight: 500;
}

.profile-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.profile-item .rank {
  width: 18px;
  height: 18px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}

.profile-item .name {
  flex: 1;
  color: var(--text-primary);
}

.profile-item .count {
  color: var(--text-secondary);
}

.profile-highlight {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-highlight .big {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-highlight .sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.profile-empty {
  color: var(--text-secondary);
  font-size: 13px;
}

/* 自然语言解读 */
.narratives {
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning);
  border-radius: var(--radius-base);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.narrative-item {
  font-size: 14px;
  color: var(--color-warning);
  line-height: 1.6;
}

/* 票价图表 */
.price-chart {
  height: 200px;
  width: 100%;
}

/* 出行日历 — Apple Calendar 风格 */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.calendar-nav-btn {
  background: var(--card-background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-primary);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-nav-btn:hover {
  background: var(--background-light);
  border-color: var(--primary);
  color: var(--primary);
}

.calendar-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.calendar-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-today-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  transition: all 0.2s;
  white-space: nowrap;
}

.calendar-today-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.calendar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.calendar-layout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.calendar-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calendar-right {
  flex: 0 0 auto;
  min-width: 0;
}

.calendar-day-info {
  background: var(--card-background);
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  padding: 10px 12px;
  margin-top: 4px;
}

[data-theme="dark"] .calendar-day-info {
  background: var(--card-background);
}

.cdi-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 8px 0;
}

[data-theme="dark"] .cdi-title {
  color: var(--text-secondary);
}

.cdi-empty {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  padding: 8px 0;
}

[data-theme="dark"] .cdi-empty {
  color: var(--text-tertiary);
}

.calendar-day-info.empty-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}

.calendar-day-info.empty-hint span {
  font-size: 12px;
  color: var(--text-secondary);
}

[data-theme="dark"] .calendar-day-info.empty-hint span {
  color: var(--text-tertiary);
}

.calendar-title-wrapper {
  position: relative;
}

.month-selector {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 12px;
  min-width: 240px;
  z-index: 100;
}

[data-theme="dark"] .month-selector {
  background: var(--card-background);
}

.month-selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.month-nav-btn {
  background: var(--color-bg-hover);
  border: none;
  border-radius: var(--radius-md);
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-color);
  transition: background 0.2s;
}

[data-theme="dark"] .month-nav-btn {
  background: var(--color-bg-muted);
}

.month-nav-btn:hover {
  background: var(--border);
}

.month-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.month-year {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-color);
}

[data-theme="dark"] .month-year {
  color: #ccc;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.month-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.2s;
}

[data-theme="dark"] .month-btn {
  color: var(--text-secondary);
}

.month-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.month-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.month-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* 日历响应式 */
@media (max-width: 768px) {
  .calendar-layout {
    flex-direction: column;
  }
  .calendar-left {
    width: 100%;
  }
  .calendar-right {
    width: 100%;
  }
  .calendar-day-info {
    width: 100%;
  }
}

.calendar-grid-wrapper {
  background: var(--card-background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

[data-theme="dark"] .calendar-grid-wrapper {
  background: var(--color-bg-surface);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.cal-weekdays span {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 0;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 4px;
}

.cal-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: var(--radius-xs);
  cursor: default;
  transition: background 0.15s;
  min-height: 38px;
  position: relative;
}

.cal-cell.cal-empty {
  cursor: default;
}

.cal-cell.cal-has-trip {
  cursor: pointer;
}

.cal-cell.cal-has-trip:hover {
  background: var(--color-primary-subtle);
}

.cal-day-num {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s;
}

/* 今天 — 暖色圆环 */
.cal-today .cal-day-num {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  font-weight: 700;
  color: var(--primary);
}

/* 选中 — 暖色实心圆 */
.cal-selected .cal-day-num {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

/* 节假日标记 */
.cal-holiday-badge {
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  pointer-events: none;
  z-index: 1;
}

.cal-holiday-badge.cal-holiday-rest {
  color: var(--color-success);
}

.cal-holiday-badge.cal-holiday-work {
  color: var(--color-error);
}

/* 频次指示符 */
.cal-indicator {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: var(--color-primary);
  transition: width 0.2s;
}

.cal-indicator.ind-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.cal-indicator.ind-short {
  width: 14px;
}

.cal-indicator.ind-long {
  width: 22px;
  opacity: 0.85;
}

/* 图例 */
.cal-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
  padding-top: 14px;
  margin-top: 4px;
}

.cal-legend .legend-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.cal-legend .legend-mark {
  display: inline-block;
  height: 4px;
  border-radius: 2px;
  background: var(--color-primary);
  flex-shrink: 0;
  margin: 0 2px;
}

.cal-legend .legend-mark.ind-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.cal-legend .legend-mark.ind-short {
  width: 14px;
}

.cal-legend .legend-mark.ind-long {
  width: 22px;
  opacity: 0.85;
}

.calendar-stats-row {
  display: flex;
  align-items: center;
  padding: 0 0 8px 0;
}

.calendar-stats-row .cs-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.calendar-stats-row .cs-empty {
  color: var(--text-secondary);
  font-style: italic;
}

/* 日历 fade 过渡 */
.cal-fade-enter-active,
.cal-fade-leave-active {
  transition: opacity 0.18s ease;
}
.cal-fade-enter-from,
.cal-fade-leave-to {
  opacity: 0;
}

.calendar-day-tickets {
  background: var(--card-background);
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  padding: 12px;
}

.calendar-day-tickets h4 {
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--text-color);
}

.day-ticket-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day-ticket-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--color-bg-hover);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid var(--border);
}

.day-ticket-card:hover {
  background: var(--border);
}

.day-ticket-card .train-num {
  font-weight: 600;
  color: var(--color-primary);
  font-size: 14px;
  flex-shrink: 0;
}

.day-ticket-card .route {
  font-size: 13px;
  color: var(--text-secondary);
}

