/* ==========================================
   base.css - 全局公共样式（重置 + 通用组件）
   供 路线筛选页、路线详情页、避坑指南页 共同引用
   最后更新：2026-06-14
   注意：此文件必须放在其他 CSS 之前引入
   ========================================== */

/* ---------- 重置 & 基础 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* ---------- 图片占位符（通用） ---------- */
.image-placeholder {
    margin: 20px 0;
    text-align: center;
}
.image-placeholder img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ---------- 底部固定按钮（筛选页 / 路线详情页） ---------- */
.bottom-buttons {
    position: fixed;
    bottom: 16px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 5px;
    z-index: 1000;
}
.bottom-btn {
    background: #2d6cb5;
    color: white;
    border: none;
    border-radius: 60px;
    padding: 9px 18px;
    font-size: 16px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
}
.bottom-btn:hover {
    background: #1e4f8a;
    transform: scale(1.02);
}

/* ---------- 响应式（针对底部按钮 - 适老化放大） ---------- */
@media (max-width: 600px) {
    .bottom-btn {
        padding: 10px 20px;      /* 增大内边距 */
        font-size: 16px;         /* 增大字号 */
        min-height: 44px;        /* 确保触摸区域 ≥44px */
        border-radius: 60px;
    }
}

footer {
    text-align: center;
    margin-top: 32px;
    padding: 8px 16px;
    color: #89A8C8;
    font-size: 0.7rem;
    font-weight: 500;
    position: relative;
    border-top: none;
}
footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 16%;
    width: 68%;
    height: 0.68px;
	border-top: 1px dashed #a0b8d0;
}

/* ★★★ 右上角徽章（左侧椭圆右侧直角） ★★★ */
.route-badge-right {
    position: absolute;
    top: 6px;
    right: 0;
    background: #eef5ff;
    color: #2d6cb5;
    padding: 2px 10px 2px 14px;
    border-radius: 40px 0 0 40px;
    font-size: 0.8rem;
    font-weight: 650;
    z-index: 1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    letter-spacing: 0.15px;
}

/* 移动端适配：缩小尺寸 */
@media (max-width: 560px) {
    .route-badge-right {
        top: 6px;
        padding: 0px 6px 0px 8px;
        font-size: 0.7rem;
        border-radius: 30px 0 0 30px;
    }
}


/* ========== 留言弹窗完整样式（移动端优化） ========== */

/* 弹窗背景 */
.msg-modal {
    display: none;
    position: fixed;
    top: 20px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: flex-start;
    padding: 20px 16px;
    box-sizing: border-box;
}
.msg-modal.show {
    display: flex;
}

/* 弹窗容器：高度撑高 50%（相对于视口高度） */
.msg-modal-content {
    background: #fff;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    height: 80vh;           /* 占视口高度的 80% ≈ 撑高 50% */
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
}

/* 固定头部 */
.msg-modal-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px 12px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    border-radius: 20px 20px 0 0;
}
.msg-modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #999;
    padding: 0 4px;
}
.msg-modal-close:hover {
    color: #333;
}

/* 滚动内容区（flex:1 撑满剩余高度） */
.msg-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px 20px 20px;
    display: flex;
    flex-direction: column;
}

/* 类别提示 */
.msg-category-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 6px;
    font-weight: 500;
}

/* 类别 + 表情触发 同一行 */
.msg-category-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}
.msg-category-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.msg-category-btn {
    padding: 4px 14px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    background: #f9f9f9;
    color: #555;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    flex: 0 0 auto;
}
.msg-category-btn.active {
    border-color: #2d6cb5;
    background: #e6f0ff;
    color: #2d6cb5;
    font-weight: 500;
}

/* 表情触发按钮（右侧） */
.msg-emoji-trigger {
    font-size: 1.6rem;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.15s;
    flex-shrink: 0;
}
.msg-emoji-trigger:hover {
    transform: scale(1.1);
}

/* 表情面板 */
.msg-emoji-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 0 12px 0;
    max-height: 150px;
    overflow-y: auto;
    border-top: 1px solid #eee;
    margin-bottom: 8px;
}
.msg-emoji-panel span {
    font-size: 1.6rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 6px;
    transition: background 0.2s;
}
.msg-emoji-panel span:hover {
    background: #e9e9e9;
}

/* 文本域容器（弹性撑开） */
.msg-textarea-wrapper {
    flex: 1;               /* 自动撑满剩余空间 */
    position: relative;
    margin: 6px 0 12px;
    min-height: 120px;      /* 保证最小高度 */
}
.msg-textarea-wrapper textarea {
    width: 100%;
    height: 100%;           /* 占满父容器高度，从而实现撑高30% */
    min-height: 120px;
    padding: 10px 50px 28px 10px;
    border: 1.5px solid #ddd;
    border-radius: 12px;
    font-size: 0.95rem;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.2s;
}
.msg-textarea-wrapper textarea:focus {
    outline: none;
    border-color: #2d6cb5;
}

/* 字数统计（右下角） */
.msg-char-count {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.8rem;
    color: #999;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.85);
    padding: 0 4px;
    border-radius: 4px;
}
.msg-char-count.warning {
    color: #f39c12;
}
.msg-char-count.danger {
    color: #e74c3c;
}

/* 提交按钮：悬浮固定在底部 */
.msg-submit {
    flex-shrink: 0;         /* 不压缩，固定在底部 */
    width: 100%;
    padding: 12px;
    background: #2d6cb5;
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 4px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
.msg-submit:hover {
    background: #1e4f8a;
}
.msg-submit:disabled {
    background: #aaa;
    cursor: not-allowed;
}


/* ===== ★★★ 天气弹窗样式（新增） ★★★ ===== */
#weatherPopup .popup-content {
    max-width: 360px;
    border-radius: 20px;
    padding: 20px 24px 24px;
    text-align: center;
}
#weatherPopup .popup-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a2f4a;
    margin-bottom: 8px;
    padding-right: 0;
}
#weatherPopup .popup-title i {
    color: #FF8C03;
}
#weatherPopup #weatherTemp {
    font-size: 2.8rem;
    font-weight: 300;
    color: #2d6cb5;
}
#weatherPopup #weatherText {
    font-size: 1.1rem;
    color: #555;
    margin-top: 2px;
}
#weatherPopup .weather-detail-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}
#weatherPopup .weather-detail-grid div {
    flex: 0 0 80px;
    background: #f0f6fe;
    padding: 8px 0;
    border-radius: 12px;
}
#weatherPopup .weather-detail-grid div span {
    display: block;
    font-size: 0.7rem;
    color: #888;
}
#weatherPopup .weather-detail-grid div strong {
    font-size: 0.95rem;
    color: #1a2f4a;
}
#weatherPopup .update-time {
    font-size: 0.7rem;
    color: #aaa;
    margin-top: 12px;
}
#weatherPopup .provider {
    font-size: 0.7rem;
    color: #ccc;
    margin-top: 14px;
}