/* 自定义样式 */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 60px;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 隐藏滚动条 */
::-webkit-scrollbar {
    display: none;
}

/* 标签页动画 */
.day-tab {
    transition: all 0.3s ease;
}

.day-tab.active {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* 卡片进入动画 */
.card-enter {
    animation: cardSlideUp 0.4s ease forwards;
    opacity: 0;
}

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

/* 景区卡片 */
.spot-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.spot-card:active {
    transform: scale(0.98);
}

/* 清单勾选 */
.checklist-item input:checked + span {
    text-decoration: line-through;
    color: #9ca3af;
}

/* 提示卡片 */
.tip-card {
    border-left: 3px solid;
    transition: all 0.2s ease;
}

.tip-card:active {
    transform: scale(0.98);
}

/* 底部导航高亮 */
.bottom-nav-active {
    color: #059669 !important;
}

/* 渐变文字 */
.gradient-text {
    background: linear-gradient(135deg, #059669, #0ea5e9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 时间线 */
.timeline-dot {
    position: relative;
}

.timeline-dot::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 100%;
    width: 2px;
    height: calc(100% + 8px);
    background: #d1d5db;
    transform: translateX(-50%);
}

.timeline-dot:last-child::after {
    display: none;
}

/* 穿搭卡片 */
.outfit-card {
    background: linear-gradient(135deg, #f0fdf4, #ecfeff);
}

/* 照片推荐卡片 */
.photo-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.photo-card img {
    transition: transform 0.3s ease;
}

.photo-card:active img {
    transform: scale(1.05);
}

/* ===== PC端响应式样式 ===== */

/* PC端导航链接 */
.pc-nav-link {
    position: relative;
    padding-bottom: 2px;
}

.pc-nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #059669, #10b981);
    transition: width 0.3s ease;
    border-radius: 1px;
}

.pc-nav-link:hover::after,
.pc-nav-link.text-emerald-600::after {
    width: 100%;
}

/* PC端hover效果增强 */
@media (min-width: 1024px) {
    html {
        scroll-padding-top: 80px;
    }

    /* PC端滚动条显示 */
    ::-webkit-scrollbar {
        display: block;
        width: 8px;
    }

    ::-webkit-scrollbar-track {
        background: #f1f5f9;
    }

    ::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

    /* 景区卡片PC端hover */
    .spot-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    }

    .spot-card:active {
        transform: translateY(-2px);
    }

    /* 提示卡片PC端hover */
    .tip-card:hover {
        transform: translateX(4px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .tip-card:active {
        transform: translateX(2px);
    }

    /* 照片卡片PC端hover */
    .photo-card:hover img {
        transform: scale(1.05);
    }

    .photo-card:active img {
        transform: scale(1.03);
    }

    /* 穿搭卡片PC端hover */
    .outfit-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    }
}

/* 平板端适配 */
@media (min-width: 768px) and (max-width: 1023px) {
    .spot-card:hover {
        transform: translateY(-2px);
    }
}

/* ===== Leaflet 地图自定义Marker样式 ===== */
.photo-marker-icon {
    background: transparent !important;
    border: none !important;
}

.custom-marker {
    position: relative;
    width: 64px;
    height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.custom-marker:hover {
    transform: translateY(-4px) scale(1.05);
    z-index: 1000 !important;
}

.marker-img-wrap {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #059669;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 2;
}

.marker-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.marker-label {
    margin-top: 4px;
    padding: 2px 8px;
    background: #059669;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 3;
}

.marker-pin {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 10px solid #059669;
    z-index: 1;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
}

/* Leaflet Popup 美化 */
.custom-popup .leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 4px;
}

.custom-popup .leaflet-popup-content {
    margin: 10px 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.custom-popup .leaflet-popup-tip {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 路线tooltip */
.route-tooltip {
    background: rgba(17, 24, 39, 0.9) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 4px 10px !important;
    font-size: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
}

.route-tooltip::before {
    border-top-color: rgba(17, 24, 39, 0.9) !important;
}

/* 地图容器圆角修复 */
#travel-map {
    border-radius: 12px;
}

#travel-map:focus {
    outline: none;
}

/* Leaflet 控件圆角 */
.leaflet-control-zoom a {
    border-radius: 6px !important;
}

/* 地图天数筛选按钮hover */
.map-day-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* 移动端marker尺寸调整 */
@media (max-width: 640px) {
    .custom-marker {
        width: 54px;
        height: 78px;
    }
    .marker-img-wrap {
        width: 46px;
        height: 46px;
        border-width: 2px;
    }
    .marker-label {
        font-size: 10px;
        padding: 1px 6px;
    }
}

/* ===== 用户位置 Marker ===== */
.user-location-icon {
    background: transparent !important;
    border: none !important;
}

.user-marker {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-dot {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    z-index: 2;
}

.user-pulse {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.4);
    transform: translate(-50%, -50%);
    animation: userPulse 2s ease-out infinite;
    z-index: 1;
}

@keyframes userPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.8);
        opacity: 0;
    }
}

/* ===== 当前步骤脉冲圈 ===== */
.current-step-pulse {
    position: relative;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
    animation: stepPulse 2s infinite;
}

@keyframes stepPulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
    70% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.current-step-circle {
    animation: circleRipple 2.2s ease-out infinite;
}

@keyframes circleRipple {
    0%, 100% { stroke-opacity: 0.8; fill-opacity: 0.15; }
    50% { stroke-opacity: 0.4; fill-opacity: 0.3; }
}

/* ===== 语音按钮 ===== */
.voice-btn {
    border: 1px solid transparent;
}

.voice-btn:hover {
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.2);
}

.voice-btn.voice-playing {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: #fff !important;
    animation: voicePulse 1.2s ease-in-out infinite;
}

.voice-btn.voice-playing i {
    animation: voiceWave 0.8s ease-in-out infinite;
}

@keyframes voicePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

@keyframes voiceWave {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ===== 提示浮层 ===== */
.locate-tip-anim {
    animation: tipSlideIn 0.3s ease-out, tipFadeOut 0.3s ease-in 2.7s forwards;
}

@keyframes tipSlideIn {
    from { transform: translate(-50%, -20px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes tipFadeOut {
    to { transform: translate(-50%, -20px); opacity: 0; }
}

/* ===== 历史文化卡片 ===== */
.culture-card {
    cursor: default;
}

.culture-card:hover img {
    transform: scale(1.05);
}

.culture-content.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 覆盖 Leaflet popup 中按钮样式 */
.leaflet-popup-content .voice-btn {
    margin-top: 2px;
}

/* 当前步骤 box hover */
#current-step-box {
    transition: all 0.3s ease;
}

#current-step-box:hover {
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
}

/* 定位按钮 */
#locate-me-btn:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}