/* heritage_route_planner.css - 智能路线推荐 + 悬停脉冲环 + 移动端浮动按钮 + 段距离标签 + 路线列表分页 */

/* ========== 悬停脉冲环 ========== */
.hover-halo-icon {
    pointer-events: none !important;
    background: transparent !important;
    border: none !important;
}
.hover-halo-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid #f0c674;
    animation: hoverHaloPulse 1.5s ease-out infinite;
    box-shadow: 0 0 20px rgba(240, 198, 116, 0.7);
}
.hover-halo-core {
    position: absolute;
    inset: 30px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240, 198, 116, 0.9), rgba(212, 162, 76, 0.3) 60%, transparent 70%);
    animation: hoverHaloCore 1.5s ease-in-out infinite;
}
@keyframes hoverHaloPulse {
    0%   { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}
@keyframes hoverHaloCore {
    0%, 100% { opacity: 0.55; transform: scale(0.9); }
    50%      { opacity: 1;    transform: scale(1.1); }
}

/* ========== 搜索卡片底部操作行 ========== */
.search-actions-row {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    align-items: stretch;
    flex-wrap: wrap;
}
.search-actions-row .back-btn {
    margin: 0 !important;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    font-size: 0.72rem;
    white-space: nowrap;
}
.route-planner-btn {
    flex: 1 1 auto;
    min-width: 0;
    padding: 9px 16px;
    background: linear-gradient(135deg, #d4a24c, #b87333);
    color: #16110c;
    border: none;
    border-radius: 30px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 3px 10px rgba(212, 162, 76, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
}
.route-planner-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(212, 162, 76, 0.5);
    background: linear-gradient(135deg, #f0c674, #d4a24c);
}
.route-planner-btn:active { transform: translateY(0); }
.route-planner-btn i { font-size: 1.05em; }

/* ========== 移动端浮动回退按钮 ========== */
.route-fab-btn {
    position: fixed;
    right: 16px;
    bottom: 24px;
    z-index: 500;
    padding: 12px 20px;
    background: linear-gradient(135deg, #d4a24c, #b87333);
    color: #16110c;
    border: none;
    border-radius: 100px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow:
        0 6px 20px rgba(212, 162, 76, 0.5),
        0 0 0 1px rgba(240, 198, 116, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    animation: routeFabIn 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.route-fab-btn i { font-size: 1em; }
.route-fab-btn:hover {
    background: linear-gradient(135deg, #f0c674, #d4a24c);
    transform: translateY(-2px);
    box-shadow:
        0 10px 26px rgba(212, 162, 76, 0.65),
        0 0 0 1px rgba(240, 198, 116, 0.6);
}
.route-fab-btn:active { transform: translateY(0); }
@keyframes routeFabIn {
    from { transform: translateY(20px) scale(0.9); opacity: 0; }
    to   { transform: translateY(0)    scale(1);   opacity: 1; }
}

/* ========== 路线面板 ========== */
.route-panel { padding-top: 4px; }

/* ========== 智能扩展提示 ========== */
.route-related-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    margin-bottom: 12px;
    background: linear-gradient(135deg,
        rgba(212, 162, 76, 0.14) 0%,
        rgba(184, 115, 51, 0.08) 100%);
    border: 1px dashed rgba(212, 162, 76, 0.5);
    border-radius: 10px;
    font-size: 0.72rem;
    color: rgba(237, 229, 216, 0.85);
    line-height: 1.5;
    animation: relatedHintIn 0.45s ease-out both;
}
.route-related-hint i {
    color: #f0c674;
    font-size: 0.95rem;
    flex-shrink: 0;
    animation: relatedHintPulse 2.4s ease-in-out infinite;
}
.route-related-hint span {
    flex: 1;
    min-width: 0;
}
.route-related-hint em {
    font-style: normal;
    color: #f0c674;
    font-weight: 700;
    padding: 1px 6px;
    background: rgba(212, 162, 76, 0.18);
    border-radius: 6px;
    margin: 0 2px;
    display: inline-block;
    line-height: 1.5;
}
@keyframes relatedHintIn {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes relatedHintPulse {
    0%, 100% { opacity: 0.7; transform: scale(1)   rotate(0deg); }
    50%      { opacity: 1;   transform: scale(1.15) rotate(-8deg); }
}

/* ========== 单条路线容器（wrapper） ========== */
.route-single-wrapper {
    animation: routeWrapperIn 0.3s ease-out both;
}
@keyframes routeWrapperIn {
    from { opacity: 0.4; transform: translateX(6px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ========== 路线卡片 ========== */
.route-card {
    margin-bottom: 12px;
    padding: 14px;
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid rgba(212, 162, 76, 0.22);
    border-radius: 14px;
    transition: border-color 0.25s;
    position: relative;
}
.route-card:hover { border-color: rgba(212, 162, 76, 0.5); }

.route-card-head {
    padding-bottom: 10px;
    margin-bottom: 6px;
    border-bottom: 1px dashed rgba(212, 162, 76, 0.2);
}
.route-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: #f0c674;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    line-height: 1.35;
}
.route-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4a24c, #b87333);
    color: #16110c;
    font-size: 0.72rem;
    font-weight: 800;
    flex-shrink: 0;
}
.route-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.7rem;
    color: rgba(237, 229, 216, 0.62);
    font-family: "SF Mono", "Consolas", "Monaco", monospace;
}
.route-meta i { color: #d4a24c; margin-right: 3px; font-size: 0.85em; }

/* ========== 站点列表：时间轴风格 ========== */
.route-stops {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 4px;
    position: relative;
    padding: 4px 0;
    animation: stopsFadeIn 0.28s ease-out both;
}
@keyframes stopsFadeIn {
    from { opacity: 0.3; transform: translateY(2px); }
    to   { opacity: 1; transform: translateY(0); }
}
.route-stops::before {
    content: "";
    position: absolute;
    left: 21px;
    top: 22px;
    bottom: 22px;
    width: 1.5px;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(212, 162, 76, 0.38) 8%,
        rgba(212, 162, 76, 0.38) 92%,
        transparent 100%);
    z-index: 0;
    pointer-events: none;
}
.route-stop {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.84rem;
    color: rgba(237, 229, 216, 0.85);
    border: 1px solid transparent;
    position: relative;
    z-index: 1;
    background: transparent;
}
.route-stop:hover {
    background: rgba(212, 162, 76, 0.10);
    color: #f0c674;
}
.route-stop:hover .route-stop-num {
    border-color: #f0c674;
    color: #f0c674;
    transform: scale(1.08);
}
.route-stop-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #16110c;
    border: 1.5px solid rgba(212, 162, 76, 0.5);
    color: #d4a24c;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: "SF Mono", "Consolas", monospace;
    flex-shrink: 0;
    transition: all 0.25s ease;
    position: relative;
    box-shadow: 0 0 0 3px #16110c;
}
.route-stop-name {
    flex: 1;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========== 每站到下一站的距离胶囊 ========== */
.route-stop-dist {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-family: "SF Mono", "Consolas", "Monaco", monospace;
    font-size: 0.66rem;
    font-weight: 700;
    color: rgba(240, 198, 116, 0.82);
    padding: 2px 8px;
    border: 1px solid rgba(212, 162, 76, 0.32);
    border-radius: 100px;
    background: rgba(212, 162, 76, 0.06);
    letter-spacing: 0.3px;
    margin-left: 4px;
    white-space: nowrap;
    transition: all 0.25s ease;
}
.route-stop-dist i {
    font-size: 0.72em;
    color: rgba(212, 162, 76, 0.7);
    opacity: 0.85;
}
.route-stop:hover .route-stop-dist {
    color: #f0c674;
    border-color: rgba(240, 198, 116, 0.6);
    background: rgba(212, 162, 76, 0.14);
    box-shadow: 0 0 8px rgba(240, 198, 116, 0.25);
}
.route-stop.touring .route-stop-dist {
    color: #16110c;
    background: radial-gradient(circle at 30% 30%, #f0c674, #d4a24c 70%, #b87333);
    border-color: #f0c674;
    box-shadow: 0 0 10px rgba(240, 198, 116, 0.75);
}
.route-stop.touring .route-stop-dist i {
    color: #16110c;
}

/* ========== 漫游时当前项高亮 ========== */
.route-stop.touring {
    background: linear-gradient(90deg,
        rgba(240, 198, 116, 0.22) 0%,
        rgba(212, 162, 76, 0.06) 55%,
        transparent 100%);
    color: #f0c674;
    font-weight: 700;
    border-color: rgba(240, 198, 116, 0.35);
    animation: routeStopTouring 1.6s ease-in-out infinite;
}
.route-stop.touring .route-stop-num {
    background: radial-gradient(circle at 30% 30%, #f0c674, #d4a24c 65%, #b87333);
    color: #16110c;
    border-color: #f0c674;
    box-shadow:
        0 0 0 3px #16110c,
        0 0 14px rgba(240, 198, 116, 0.9);
    transform: scale(1.12);
    font-weight: 800;
}
.route-stop.touring .route-stop-name {
    letter-spacing: 0.3px;
}
@keyframes routeStopTouring {
    0%, 100% {
        box-shadow: 0 0 0 1px rgba(240, 198, 116, 0.15) inset;
    }
    50% {
        box-shadow: 0 0 0 1px rgba(240, 198, 116, 0.5) inset,
                    0 0 14px rgba(240, 198, 116, 0.28);
    }
}

/* ========== 站点分页条（路线内） ========== */
.route-stops-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 6px 0 4px;
    margin-bottom: 8px;
    border-top: 1px dashed rgba(212, 162, 76, 0.2);
}
.route-stops-page-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(212, 162, 76, 0.4);
    color: #d4a24c;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.22s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-family: inherit;
    flex-shrink: 0;
}
.route-stops-page-btn:hover:not(:disabled) {
    background: rgba(212, 162, 76, 0.25);
    border-color: #d4a24c;
    color: #f0c674;
    box-shadow: 0 0 10px rgba(240, 198, 116, 0.35);
}
.route-stops-page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.route-stops-page-info {
    font-family: "SF Mono", "Consolas", "Monaco", monospace;
    font-size: 0.7rem;
    color: rgba(237, 229, 216, 0.6);
    letter-spacing: 1px;
    min-width: 44px;
    text-align: center;
}

/* ========== 路线列表分页条（多条路线之间切换） ========== */
.route-list-pager {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin: 10px 0 12px;
    padding: 10px 8px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(212, 162, 76, 0.25);
    border-radius: 12px;
    animation: routeWrapperIn 0.3s ease-out both;
}
.route-list-pager:empty { display: none !important; }
.route-list-page-btn {
    background: rgba(212, 162, 76, 0.12);
    border: 1px solid rgba(212, 162, 76, 0.45);
    color: #d4a24c;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.22s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-family: inherit;
    flex-shrink: 0;
}
.route-list-page-btn:hover:not(:disabled) {
    background: #d4a24c;
    color: #16110c;
    border-color: #f0c674;
    box-shadow: 0 0 14px rgba(240, 198, 116, 0.55);
    transform: scale(1.06);
}
.route-list-page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.route-list-page-info {
    font-family: "SF Mono", "Consolas", "Monaco", monospace;
    font-size: 0.78rem;
    font-weight: 700;
    color: #f0c674;
    letter-spacing: 1.5px;
    min-width: 90px;
    text-align: center;
}

/* ========== 路线操作按钮 ========== */
.route-actions { display: flex; gap: 8px; margin-top: 4px; }
.route-btn {
    flex: 1;
    padding: 8px 12px;
    background: rgba(212, 162, 76, 0.12);
    border: 1px solid rgba(212, 162, 76, 0.4);
    border-radius: 20px;
    color: #d4a24c;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.22s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.route-btn:hover {
    background: #d4a24c;
    color: #16110c;
    border-color: #d4a24c;
    box-shadow: 0 4px 14px rgba(212, 162, 76, 0.35);
}
.route-btn i { font-size: 0.85em; }

.route-stop-tour-bar { margin-top: 10px; text-align: center; }
.route-stop-tour-bar .route-btn {
    max-width: 200px;
    margin: 0 auto;
    background: rgba(238, 88, 68, 0.15);
    border-color: rgba(238, 88, 68, 0.5);
    color: #ee5844;
}
.route-stop-tour-bar .route-btn:hover {
    background: #ee5844;
    border-color: #ee5844;
    color: #fff;
    box-shadow: 0 4px 14px rgba(238, 88, 68, 0.4);
}

/* ========== 地图上路线序号徽章 ========== */
.route-seq-icon {
    pointer-events: none;
    background: transparent !important;
    border: none !important;
}
.route-seq-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #f0c674, #d4a24c 60%, #b87333);
    color: #16110c;
    font-size: 0.78rem;
    font-weight: 800;
    font-family: "SF Mono", "Consolas", monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.55),
        0 0 0 2px rgba(22, 17, 12, 0.85),
        0 0 14px rgba(212, 162, 76, 0.65);
    animation: routeBadgeIn 0.4s ease-out both;
}
@keyframes routeBadgeIn {
    from { transform: scale(0.4); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

/* ========== 移动端：地图虚线上的段距离标签 ========== */
.route-leg-label-icon {
    pointer-events: none !important;
    background: transparent !important;
    border: none !important;
    width: 0;
    height: 0;
    overflow: visible;
}
.route-leg-label {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-50%, -50%);
    display: inline-block;
    padding: 3px 10px;
    background: rgba(22, 17, 12, 0.92);
    color: #f0c674;
    font-family: "SF Mono", "Consolas", "Monaco", monospace;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    border: 1.5px solid rgba(212, 162, 76, 0.75);
    border-radius: 100px;
    white-space: nowrap;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.6),
        0 0 12px rgba(212, 162, 76, 0.35);
    animation: legLabelIn 0.35s ease-out both;
}
@keyframes legLabelIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ========== 响应式 ========== */
@media (max-width: 767px) {
    .route-title { font-size: 0.92rem; }
    .route-stop { font-size: 0.8rem; padding: 6px 6px; gap: 10px; }
    .route-btn { font-size: 0.72rem; padding: 7px 10px; }
    .route-stop-num { width: 24px; height: 24px; font-size: 0.66rem; }
    .route-stops::before { left: 19px; }
    .route-stop-dist { font-size: 0.62rem; padding: 1px 7px; }
    .search-actions-row { gap: 6px; }
    .route-planner-btn { font-size: 0.75rem; padding: 8px 12px; }
    .search-actions-row .back-btn { padding: 0 10px; font-size: 0.68rem; }
    .route-leg-label { font-size: 0.66rem; padding: 2px 8px; }
    .route-related-hint { font-size: 0.68rem; padding: 8px 10px; }
    .route-related-hint em { padding: 0 4px; }
    .route-stops-page-btn { width: 24px; height: 24px; font-size: 0.66rem; }
    .route-stops-page-info { font-size: 0.66rem; min-width: 40px; }
    .route-list-page-btn { width: 30px; height: 30px; font-size: 0.72rem; }
    .route-list-page-info { font-size: 0.72rem; min-width: 80px; letter-spacing: 1px; }
    .route-list-pager { gap: 10px; margin: 8px 0 10px; padding: 8px 6px; }
}