* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

:root {
    --primary-color: #ef4411;
    --secondary-color: #FF9800;
    --accent-color: #10b981;
    --orange-color: #f9941a;
    --dark-color: #111827;
    --light-color: #f9fafb;
    --gray-color: #6b7280;
    --green-light: #dcfce7;
    --green-dark: #059669;
    --border-radius: 12px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    /* 新增侧边栏相关变量 */
    --sidebar-width: 300px;
    --sidebar-bg: white;
    --sidebar-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
}

body {
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 头部样式 */
.route-header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}
/* 主内容区 */
.route-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

/* 服务项目 */
.services-section {
    background-color: white;
    padding: 15px;
}

.route-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* 确保在移动设备上也是2列布局 */
@media (max-width: 768px) {
    .services-section{
        padding:15px;
    }
    .route-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .route-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* 游戏/计算器卡片 */
.route-card {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.route-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.route-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    transition: all 0.3s ease;
}

.route-card:hover .route-icon {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.route-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

.route-card p {
    font-size: 14px;
    color: var(--gray-color);
    margin: 0;
    line-height: 1.4;
}

/* ===== 弹窗样式 ===== */

/* 触摸提示 */
.touch-hint {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
    animation: bounce 2s infinite;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.touch-hint i {
    font-size: 16px;
    color: var(--secondary-color);
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

/* 旅游路线弹窗 - 修复：同时支持ID和class选择器 */
#tourModal,
.tour-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

#tourModal.active,
.tour-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

#tourModal .modal-overlay,
.tour-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#tourModal.active .modal-overlay,
.tour-modal.active .modal-overlay {
    opacity: 1;
}

#tourModal .modal-content,
.tour-modal .modal-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 85%;
    background: white;
    border-radius: 25px 25px 0 0;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.4s ease;
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.15);
}

#tourModal.active .modal-content,
.tour-modal.active .modal-content {
    transform: translateY(0);
}

/* 弹窗头部 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 25px 15px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.modal-title h2 {
    font-size: 24px;
    color: var(--dark-color);
    margin-bottom: 5px;
    line-height: 1.3;
}

.modal-title p {
    color: var(--gray-color);
    font-size: 14px;
    margin: 0;
}

.modal-close {
    background: #f5f5f5;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--dark-color);
    font-size: 18px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #e5e5e5;
    transform: rotate(90deg);
}

/* Swiper容器 - 修复选择器 */
.swiper-container {
    flex: 1;
    width: 100%;
    height: 100%;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.swiper-wrapper {
    height: 100%;
}

.swiper-slide {
    height: 100%;
    padding: 0 25px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

/* 旅游路线幻灯片 */
.tour-slide {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding-bottom: 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f0f0f0;
}

.tour-slide::-webkit-scrollbar {
    width: 4px;
}

.tour-slide::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 2px;
}

.tour-slide::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

/* 添加路线进度条 */
.route-progress {
    position: absolute;
    top: 15px;
    left: 25px;
    right: 25px;
    height: 4px;
    background: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
    z-index: 5;
}

.route-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    width: 0%;
    transition: width 0.4s ease;
    position: relative;
    overflow: hidden;
}

.route-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.slide-header {
    margin-bottom: 25px;
    padding-top: 10px;
    flex-shrink: 0;
}

.tour-number {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.slide-header h3 {
    font-size: 22px;
    color: var(--dark-color);
    margin-bottom: 8px;
    line-height: 1.3;
}

.tour-distance {
    color: var(--gray-color);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tour-distance:before {
    content: "📍";
    font-size: 12px;
}

/* 幻灯片内容 */
.slide-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.tour-description {
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark-color);
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.tour-highlights {
    margin-bottom: 25px;
}

.tour-highlights h4 {
    font-size: 16px;
    color: var(--dark-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tour-highlights i {
    color: var(--secondary-color);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: var(--green-light);
    color: var(--green-dark);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

/* 详情卡片网格 */
.tour-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 25px 0;
}

.detail-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.detail-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.detail-icon {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 18px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.detail-text {
    flex: 1;
    min-width: 0;
}

.detail-label {
    font-size: 12px;
    color: var(--gray-color);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-value {
    font-size: 14px;
    color: var(--dark-color);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 温馨提示卡片 */
.tour-tips-card {
    background: #fff7ed;
    border-radius: 12px;
    padding: 18px;
    margin-top: 25px;
    border-left: 4px solid var(--orange-color);
}

.tips-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.tips-header i {
    color: var(--orange-color);
    font-size: 18px;
    flex-shrink: 0;
}

.tips-header h4 {
    font-size: 15px;
    color: var(--dark-color);
    margin: 0;
}

.tour-tips-card p {
    color: #7c2d12;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* Swiper分页器和导航 */
/* Swiper分页器 - 美化 */
.swiper-pagination {
    bottom: 10px !important;
    position: absolute;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: rgba(0, 0, 0, 0.2);
    opacity: 1;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 4px;
}

.swiper-pagination-bullet-active {
    background: var(--primary-color);
    width: 24px;
    transform: scale(1);
    box-shadow: 0 0 0 2px rgba(239, 68, 17, 0.1);
}

/* 给分页器添加数字 */
.swiper-pagination-bullet::after {
    content: attr(data-index);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: var(--gray-color);
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s ease;
    background: white;
    padding: 2px 6px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.swiper-pagination-bullet:hover::after,
.swiper-pagination-bullet-active::after {
    /*opacity: 1;*/
    top: -20px;
}

/* Swiper导航按钮 - 美化 */
.swiper-button-prev,
.swiper-button-next {
    background: #ffd8c5;
    width: 2rem!important;
    height: 2rem!important;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color)!important;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    cursor: pointer;
    opacity: 0.9;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    opacity: 1;
    color: var(--light-color)!important;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.swiper-button-prev:active,
.swiper-button-next:active {
    transform: translateY(-50%) scale(0.95);
    transition: all 0.1s ease;
}

.swiper-button-prev::after,
.swiper-button-next::after {
    display: none;
}

.swiper-button-prev {
    left: 20px;
}

.swiper-button-next {
    right: 20px;
}

.swiper-button-prev i,
.swiper-button-next i {
    transition: all 0.3s ease;
}

.swiper-button-prev:hover i,
.swiper-button-next:hover i {
    transform: scale(1.2);
}

/* 添加按钮脉冲动画 */
@keyframes buttonPulse {
    0%, 100% { 
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 
                    0 0 0 0 rgba(239, 68, 17, 0.4); 
    }
    50% { 
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 
                    0 0 0 10px rgba(239, 68, 17, 0); 
    }
}

.swiper-button-prev.pulse,
.swiper-button-next.pulse {
    animation: buttonPulse 2s infinite;
}


/* 弹窗底部按钮 */
.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #f0f0f0;
    background: white;
    flex-shrink: 0;
}

.select-tour-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.select-tour-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 17, 0.3);
}

.select-tour-btn:active {
    transform: translateY(0);
}

.select-tour-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.select-tour-btn:hover:before {
    left: 100%;
}

/* 确认弹窗 - 修复：同时支持ID和class选择器 */
#confirmModal,
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

#confirmModal.active,
.confirm-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

#confirmModal .modal-overlay,
.confirm-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#confirmModal.active .modal-overlay,
.confirm-modal.active .modal-overlay {
    opacity: 1;
}

.confirm-content {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 450px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

#confirmModal.active .confirm-content,
.confirm-modal.active .confirm-content {
    transform: scale(1);
}

.confirm-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 40px;
}

.confirm-icon.success {
    background: #dcfce7;
    color: #059669;
    animation: successPulse 1s ease;
}

@keyframes successPulse {
    0% { transform: scale(0.8); opacity: 0.5; }
    70% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.confirm-content h3 {
    text-align: center;
    color: var(--dark-color);
    margin-bottom: 10px;
    font-size: 22px;
}

.confirm-content > p {
    text-align: center;
    color: var(--gray-color);
    margin-bottom: 25px;
    font-size: 15px;
    line-height: 1.5;
}

.confirm-details {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #e5e7eb;
}

.confirm-details p {
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    line-height: 1.4;
}

.confirm-details i {
    color: var(--primary-color);
    width: 20px;
    flex-shrink: 0;
}

.confirm-tips {
    font-size: 14px;
    color: var(--gray-color);
    text-align: center;
    font-style: italic;
    margin: 20px 0;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 14px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    font-size: 15px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(239, 68, 17, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #f3f4f6;
    color: var(--dark-color);
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* 滑动指示器美化 */
.swipe-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--gray-color);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    opacity: 0.9;
    animation: fadeInOut 3s infinite;
    z-index: 1;
}

@keyframes fadeInOut {
    0%, 100% { 
        opacity: 0.7; 
        transform: translateX(-50%) translateY(0);
    }
    50% { 
        opacity: 1; 
        transform: translateX(-50%) translateY(-5px);
    }
}

.swipe-hint i {
    font-size: 14px;
    color: var(--primary-color);
    animation: swing 2s infinite ease-in-out;
}

@keyframes swing {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}


/* 防止滚动穿透 */
body.modal-open {
    overflow: hidden;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #tourModal .modal-content,
    .tour-modal .modal-content {
        height: 90%;
    }
    
    .modal-title h2 {
        font-size: 20px;
    }
    
    .swiper-slide {
        padding: 0 20px;
    }
    
    .slide-header h3 {
        font-size: 20px;
    }
    
    .tour-details-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    /* 修改：移动端不隐藏按钮，而是调整位置 */
    .swiper-button-prev,
    .swiper-button-next {
        width: 1.8rem!important;
        height: 1.8rem!important;
    }
    
    .modal-footer {
        padding: 15px 20px;
    }
    
    .select-tour-btn {
        padding: 14px;
        font-size: 15px;
    }
    
    .confirm-content {
        padding: 25px;
        width: 95%;
    }
    
    .confirm-buttons {
        flex-direction: column;
    }
    
    .touch-hint {
        bottom: 70px;
        font-size: 13px;
        padding: 10px 16px;
    }

    .swipe-hint {
        bottom: 60px;
        font-size: 12px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    #tourModal .modal-content,
    .tour-modal .modal-content {
        height: 95%;
        border-radius: 20px 20px 0 0;
    }
    
    .swiper-slide {
        padding: 0 15px;
    }
    
    .slide-header h3 {
        font-size: 18px;
    }
    
    .tour-description {
        font-size: 15px;
    }
    
    .tag {
        font-size: 12px;
        padding: 5px 12px;
    }
    
    .detail-card {
        padding: 12px;
    }
    
    .detail-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .touch-hint {
        bottom: 60px;
        font-size: 13px;
        padding: 10px 16px;
    }
    
    .confirm-content {
        padding: 20px;
    }
    
    .confirm-icon {
        width: 60px;
        height: 60px;
        font-size: 32px;
    }

    .swiper-pagination-bullet {
        width: 6px;
        height: 6px;
    }
    
    .swiper-pagination-bullet-active {
        width: 20px;
    }

    .swipe-hint {
        bottom: 50px;
        font-size: 11px;
        padding: 5px 10px;
    }
}