/* =========================================================
   手机版独立样式 mobile.css（≤768px）
   风格参考：飞猪旅行（橙色主题 · 顶部搜索 · 金刚区 · 信息流卡片）
   主色：var(--primary) 飞猪橙
   ========================================================= */
:root {
    --m-primary: var(--primary, #2563eb);
    --m-primary-dark: var(--primary-dark, #1d4ed8);
    --m-gold: var(--secondary, #f59e0b);
    --m-ink: #1a1a1a;
    --m-sub: #8a8a8a;
    --m-line: #f0f0f0;
    --m-bg: #f5f6f8;
    --m-card: #ffffff;
    --m-radius: 12px;
}

@media (max-width: 768px) {

body { font-size: 14px; background: var(--m-bg); color: var(--m-ink); }
.container { padding: 0 12px; }
a { -webkit-tap-highlight-color: transparent; }

/* ================= 顶部工具栏 ================= */
/* 手机端顶部：只留登录/注册（400电话和其他链接隐藏） */
.top-bar { display: flex !important; background: var(--m-primary); padding: 6px 0; font-size: 12px; }
.top-bar .container { justify-content: center; }
.top-bar-left { display: none; }
.top-bar-right a { display: none; }
.top-bar-right a[href*="login"], .top-bar-right a[href*="register"] { display: inline-block; color: #fff; margin: 0 12px; }
.top-bar-left span:not(:first-child) { display: none; }
.top-bar-right { display: none; } /* 手机端只留400电话，右侧链接在菜单/TabBar中 */

/* ================= 主导航 ================= */
.main-header { background: var(--m-primary); box-shadow: none; position: sticky; top: 0; z-index: 90; }
.main-header .container { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; }
.logo h1 { font-size: 18px; margin: 0; color: #fff; }
.logo span { display: none; }
.main-nav { display: none; }
.menu-toggle { display: block; font-size: 22px; color: #fff; padding: 4px; }
.mobile-menu { background: #fff; }
.mobile-menu ul li a { padding: 13px 18px; font-size: 15px; border-bottom: 1px solid #f5f5f5; }

/* ================= 顶部搜索+轮播容器 ================= */
.m-hero-wrap { position: relative; }

/* ================= 顶部搜索（浮在美景轮播上） ================= */
.search-section { position: absolute; left: 12px; right: 12px; bottom: 14px; z-index: 15; background: transparent; padding: 0; margin-top: 0 !important; }
.search-box { background: #fff; border-radius: 24px; padding: 4px; box-shadow: 0 6px 24px rgba(0,0,0,.15); }
.search-box form { display: flex; align-items: center; }
.search-box .search-row { display: flex; align-items: center; width: 100%; gap: 4px; flex-direction: row !important; }
.search-box .search-group { display: flex; align-items: center; flex: 1; height: 38px; padding: 0 6px 0 12px; border-radius: 20px; min-width: 0; }
.search-box .search-group i { color: #b6bac3; margin-right: 8px; font-size: 15px; flex-shrink: 0; }
.search-box .search-group input { border: none; outline: none; width: 100%; font-size: 14px; background: transparent; color: #1a1a1a; }
.search-box select { display: none; }
.search-box button { width: 38px; height: 38px; border-radius: 50%; border: none; background: linear-gradient(135deg,var(--primary),var(--primary-dark)); color: #fff; font-size: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,.22); cursor: pointer; }

/* ================= 轮播 Banner（美景图，搜索框浮在上面） ================= */
.hero-slider { padding: 0; height: 250px; }
.hero-slider .slider-container { height: 100%; }
.hero-slider .slider-container .slide, .hero-slider .slide { height: 250px; }
.slide-content { padding-top: 50px; }
.slide-content .btn { display: none; }
.slide-content h2 { font-size: 20px; font-weight: 800; }
.slide-content p { font-size: 13px; }
.slide-content .btn { display: none; }
.slider-prev, .slider-next { display: none; }

/* ================= 金刚区（分类宫格，飞猪式） ================= */
.categories-section { padding: 4px 0 0; }
.categories-section .section-header { display: none; }
.categories-grid { grid-template-columns: repeat(5, 1fr); gap: 4px; background: #fff; border-radius: var(--m-radius); padding: 10px 6px; box-shadow: 0 1px 6px rgba(0,0,0,.04); }
.category-card { background: transparent; box-shadow: none; padding: 10px 2px; }
.category-card .category-icon { font-size: 22px !important; width: 44px; height: 44px; line-height: 44px; border-radius: 50%; margin: 0 auto 6px; display: flex; align-items: center; justify-content: center; background: #fff3e8; }
.category-card h3 { font-size: 12px; font-weight: 500; margin: 0; color: var(--m-ink); }
.category-card p, .category-card .category-link { display: none; }

/* ================= 区块标题 ================= */
.section-header { text-align: left; margin: 16px 0 10px; padding: 0 2px; }
.section-header h2 { font-size: 17px; font-weight: 800; }
.section-header p { font-size: 12px; color: var(--m-sub); margin-top: 2px; }

/* ================= 线路信息流卡片（飞猪式） ================= */
.featured-section, .routes-section { padding: 0 0 12px; }
.routes-grid { grid-template-columns: 1fr; gap: 12px; }
.route-card { background: #fff; border-radius: var(--m-radius); overflow: hidden; box-shadow: 0 1px 8px rgba(0,0,0,.06); border: none; }
.route-card .route-card-img, .route-card img { height: 180px; object-fit: cover; width: 100%; }
.route-card .route-info { padding: 10px 12px 12px; }
.route-card .route-title { font-size: 15px; font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 6px; }
.route-card .route-meta { font-size: 12px; color: var(--m-sub); margin: 4px 0 8px; }
.route-card .route-price { color: var(--m-gold); font-size: 20px; font-weight: 800; }
.route-card .route-price small { font-size: 12px; color: var(--m-sub); font-weight: 400; }
.route-tag { background: #fff3e8; color: var(--m-primary); border-radius: 4px; padding: 2px 8px; font-size: 11px; font-weight: 600; }

/* ================= 列表页 ================= */
.page-hero { padding: 24px 0; background: linear-gradient(135deg,var(--primary),var(--primary-dark)); }
.page-hero h1 { font-size: 21px; font-weight: 800; color: #fff; }
.page-hero p { color: rgba(255,255,255,.85); font-size: 13px; }
.filter-bar { background: #fff; border-radius: var(--m-radius); padding: 10px 12px; box-shadow: 0 1px 6px rgba(0,0,0,.05); margin: 12px 0; flex-direction: column; align-items: stretch; gap: 8px; }
.filter-categories { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; gap: 8px; width: 100%; display: flex; flex: 1 1 auto; min-width: 0; }
.filter-categories a { white-space: nowrap; border-radius: 16px; padding: 6px 14px; font-size: 13px; background: #f2f3f5; color: var(--m-sub); }
.filter-categories a.active { background: var(--m-primary); color: #fff; }

/* ================= 线路详情页 ================= */
.route-detail-header { padding: 12px 0; }
.route-detail-grid { grid-template-columns: 1fr; gap: 12px; }
.route-detail-image img, .route-detail-image div[style*="height:400px"] { height: 210px !important; border-radius: var(--m-radius); }
.route-detail-info h1 { font-size: 19px; font-weight: 800; line-height: 1.4; }
.route-quick-info { grid-template-columns: 1fr 1fr; gap: 8px; }
.route-quick-info > div { background: #fff; border-radius: 10px; padding: 10px 12px; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.route-quick-info strong { display: block; font-size: 11px; color: var(--m-sub); font-weight: 500; }
.route-quick-info span { font-size: 14px; font-weight: 700; }
.route-price-box { background: #fff; border-radius: var(--m-radius); padding: 12px 14px; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.route-price { font-size: 26px; font-weight: 800; color: var(--m-gold); }
.route-original-price { font-size: 13px; color: #aaa; text-decoration: line-through; }
.route-discount-tag { background: #fff0e6; color: var(--m-primary); border-radius: 4px; padding: 2px 8px; font-size: 11px; font-weight: 600; }

/* ================= 行程/费用 ================= */
.highlights-section, .itinerary-section, .fee-section, .notes-section, .schedules-section { padding: 12px 0; }
.highlights-content, .itinerary-content, .notes-content, .fee-card { background: #fff; border-radius: var(--m-radius); padding: 13px; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.timeline { padding-left: 0; }
.timeline::before { display: none; }
.timeline-marker { position: static; width: auto; text-align: left; margin-bottom: 8px; }
.day-badge { font-size: 11px; padding: 4px 12px; border-radius: 20px; background: linear-gradient(135deg,var(--primary),var(--primary-dark)); }
.day-images { grid-template-columns: 1fr 1fr; gap: 8px; }
.timeline-content { background: #fff; border-radius: var(--m-radius); padding: 13px; max-width: 100%; box-shadow: 0 1px 6px rgba(0,0,0,.05); border: none; }
.timeline-item { margin-bottom: 12px; }
.day-header h3 { font-size: 15px; font-weight: 700; }
.day-tag { font-size: 12px; padding: 3px 8px; border-radius: 6px; }

/* ================= 排期表 ================= */
.schedules-section .table-responsive { background: #fff; border-radius: var(--m-radius); box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.schedule-table { font-size: 12px; }
.schedule-table th, .schedule-table td { padding: 8px 6px; }
.schedule-date { font-size: 13px; font-weight: 700; }
.schedule-price { font-size: 15px; color: var(--m-gold); font-weight: 800; }

/* ================= 通用 ================= */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.btn, .btn-sm, .btn-lg { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; }
a.btn-sm { min-height: 34px; }
.btn-primary { background: linear-gradient(135deg,var(--primary),var(--primary-dark)); border: none; box-shadow: 0 3px 10px rgba(0,0,0,.18); }

/* ================= 底部 ================= */
.site-footer { background: #1a1a1a; }
.footer-grid { grid-template-columns: 1fr 1fr; gap: 18px; }
.footer-col:first-child { grid-column: 1 / -1; }
.footer-col h3 { font-size: 14px; color: #fff; }
.footer-col p, .footer-col li, .footer-col a, .footer-col span { color: #9a9a9a; font-size: 12px; }
.footer-bottom { font-size: 11px; }

/* ================= 浮动按钮 ================= */
.float-phone, .float-wechat { display: none; }
.float-consult { bottom: 30px; }

/* ================= 弹窗 ================= */
.bk-modal-panel { max-width: 100%; border-radius: 16px 16px 0 0; }
.bk-modal-body { padding: 14px; }
}

/* ≤480px */
@media (max-width: 480px) {
    .hero-slider { height: 150px; }
    .routes-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .route-card .route-card-img, .route-card img { height: 88px; }
    .categories-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ========== 橙色统一覆盖（解决与旧蓝色主题的冲突） ========== */
@media (max-width: 768px) {
    /* 预订底栏按钮（route.php 内联蓝色 -> 橙） */
    .bk-btn-buy { background: linear-gradient(135deg,var(--primary),var(--primary-dark)) !important; box-shadow: 0 3px 10px rgba(0,0,0,.18) !important; }
    .bk-btn-share { border-color: var(--primary) !important; color: var(--primary) !important; }
    /* AI客服球（蓝紫渐变 -> 橙渐变） */
    #chatbot-fab { background: linear-gradient(135deg,var(--primary),var(--primary-dark)) !important; box-shadow: 0 4px 20px rgba(0,0,0,.25) !important; }
    #chatbot-fab .fab-pulse { border-color: var(--primary) !important; }
    /* 客服面板头部/发送按钮 */
    #chatbot-panel .chat-header, .chat-send-btn, #chatbot-send { background: linear-gradient(135deg,var(--primary),var(--primary-dark)) !important; }
    /* 预订弹窗内小字蓝色（游客名字/性别/年龄） */
    .bk-modal-body [style*="color:#2563eb"] { color: var(--primary) !important; }
    /* 排期表立即预订按钮 */
    .schedule-book-btn { background: linear-gradient(135deg,var(--primary),var(--primary-dark)) !important; }
    /* 详情页图集选中边框 */
    .route-thumb[style*="#2563eb"] { border-color: var(--primary) !important; }
}

/* ========== 底部 TabBar（飞猪小程序风格） ========== */
@media (max-width: 768px) {
    body { padding-bottom: 58px; }
    .m-tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 997; display: flex; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 -2px 12px rgba(0,0,0,.06); padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px)); }
    .m-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: #9a9a9a; font-size: 10px; }
    .m-tab i { font-size: 20px; }
    .m-tab.active { color: var(--m-primary); }
    .m-tab.active i { font-weight: 900; }
}

/* ========== 线路列表筛选区（routes.php） ========== */
@media (max-width: 768px) {
    /* 搜索框：独立一行，胶囊化 */
    .filter-actions { width: 100%; margin-top: 10px; }
    .filter-search { display: flex; width: 100%; }
    .filter-search input { flex: 1; border: 1px solid #eee; border-radius: 20px 0 0 20px; padding: 9px 14px; font-size: 14px; background: #f7f8fa; outline: none; }
    .filter-search button { border: none; background: var(--m-primary); color: #fff; border-radius: 0 20px 20px 0; padding: 0 16px; }
    /* 城市筛选：横向滑动，不换行 */
    .city-filter { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 6px; padding-bottom: 8px; scrollbar-width: none; }
    .city-filter::-webkit-scrollbar { display: none; }
    .city-filter-label { white-space: nowrap; flex-shrink: 0; }
    .city-btn { white-space: nowrap; flex-shrink: 0; border-radius: 14px; padding: 5px 12px; font-size: 12px; }
}

/* ========== 聊天窗口：手机版底部弹层（非全屏） ========== */
@media (max-width: 768px) {
    #chatbot-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        height: 72vh;
        max-height: 72vh;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -6px 30px rgba(0,0,0,.15);
    }
}

/* ========== 列表页顶部搜索条（routes.php） ========== */
@media (max-width: 768px) {
    .list-search { background: linear-gradient(135deg,var(--primary),var(--primary-dark)); padding: 10px 0 12px; }
    .list-search .filter-search input { flex: 1; border: none; border-radius: 20px 0 0 20px; padding: 9px 14px; font-size: 13px; background: #fff; outline: none; }
    .list-search .filter-search button { border: none; background: #1a1a1a; color: #fff; border-radius: 0 20px 20px 0; padding: 0 16px; }
}

/* =====================================================
   routes.php 列表页 · 整体重写（飞猪小程序风格）
   ===================================================== */
@media (max-width: 768px) {

/* 顶部搜索条 */
.list-search { background: linear-gradient(135deg,var(--primary),var(--primary-dark)); padding: 12px 0; position: sticky; top: 52px; z-index: 40; }
.list-search .container { padding: 0 12px; }
.list-search .filter-search { display: flex; background: #fff; border-radius: 22px; padding: 4px; box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.list-search .filter-search input { flex: 1; border: none; background: transparent; padding: 8px 14px; font-size: 14px; outline: none; }
.list-search .filter-search button { border: none; background: #1a1a1a; color: #fff; border-radius: 18px; padding: 0 18px; font-size: 13px; font-weight: 600; }

/* 去掉大标题区（列表页不需要） */
.page-hero { display: none; }

/* 筛选区：白卡 + 分类横滑 + 城市横滑 */
.filter-section { padding: 10px 0 0; }
.filter-section .container { padding: 0 12px; }
.filter-bar { background: #fff; border-radius: 12px; padding: 12px; box-shadow: 0 1px 6px rgba(0,0,0,.04); display: block; }
.filter-categories { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; padding-bottom: 2px; }
.filter-categories::-webkit-scrollbar { display: none; }
.filter-categories .filter-btn { white-space: nowrap; padding: 7px 0; min-height: 34px; width: 100%; display: flex; align-items: center; justify-content: center; border-radius: 18px; font-size: 13px; font-weight: 500; border: none; background: #f2f3f5; color: #6b7280; box-sizing: border-box; }
.filter-categories .filter-btn.active { background: linear-gradient(135deg,var(--primary),var(--primary-dark)); color: #fff; }

/* 城市横滑 */
.city-filter { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #f3f4f6; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.city-filter::-webkit-scrollbar { display: none; }
.city-filter-label { flex-shrink: 0; white-space: nowrap; font-size: 12px; color: #9ca3af; }
.city-btn { flex-shrink: 0; white-space: nowrap; padding: 5px 12px; border-radius: 14px; font-size: 12px; border: none; background: #f7f8fa; color: #6b7280; }
.city-btn.active { background: #fff3e8; color: var(--primary); font-weight: 600; }

/* 线路列表：单列大图卡片 */
.routes-list-section { padding: 14px 0 20px; }
.routes-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.route-card { display: block; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 8px rgba(0,0,0,.05); border: none; text-decoration: none; }
.route-card .route-img { position: relative; width: 100%; height: 170px; background-size: cover !important; background-position: center !important; }
.route-card .route-info { padding: 12px 14px 14px; }
.route-card .route-info h3 { font-size: 15px; font-weight: 700; color: #111827; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0 0 6px; }
.route-type-badge { position: absolute; top: 10px; left: 10px; display: inline-block; background: var(--primary); color: #fff; font-size: 11px; font-weight: 600; border-radius: 4px; padding: 2px 8px; }
.route-meta { font-size: 12px; color: #9ca3af; margin-bottom: 8px; }
.route-meta span { margin-right: 10px; }
.route-price { font-size: 20px; font-weight: 800; }
.route-price .price { color: var(--primary) !important; font-weight: 800; }
.route-price small { font-size: 12px; color: #c0c4cc; font-weight: 400; }
.route-original-price { font-size: 12px; color: #c0c4cc; font-weight: 400; text-decoration: line-through; margin-left: 6px; }
.route-discount { position: absolute; top: 10px; right: 10px; display: inline-block; background: rgba(254,226,226,.95); color: #ef4444; font-size: 11px; font-weight: 600; border-radius: 4px; padding: 2px 8px; }

/* 空状态 */
.empty-state { padding: 40px 20px; text-align: center; color: #9ca3af; }
}

/* ========== 预订弹窗间距压缩 ========== */
@media (max-width: 768px) {
    .bk-modal-body { padding: 10px 12px !important; }
    .bk-modal-body .form-group { margin-bottom: 9px !important; }
    .bk-modal-body label { margin-bottom: 4px !important; }
    .bk-modal-body .guest-entry { margin-bottom: 6px !important; }
    .bk-modal-body input, .bk-modal-body textarea { padding: 8px 10px !important; }
}
