/* ======================================================
   pages/daohang.css — 骑行导航页专属样式
   ====================================================== */

/* ===== 页面基础 ===== */
body { padding-top: 0 !important; }
.map-type-toggle { top: 16px !important; }

/* ===== 搜索面板（顶部） ===== */
.nav-search-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1010;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    padding: 10px 12px;
    transition: transform 0.3s ease;
}
.nav-search-panel.collapsed {
    transform: translateY(-100%);
}
.nav-search-panel .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.nav-search-panel .panel-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* ===== 起终点输入 ===== */
.nav-route-inputs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}
.nav-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-input-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}
.nav-input-dot.start {
    background: #52c41a;
    border: 2px solid #52c41a;
}
.nav-input-dot.end {
    background: #f5222d;
    border: 2px solid #f5222d;
}
.nav-input-dot.start::after,
.nav-input-dot.end::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #fff;
}
.nav-input-field {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-light);
    border-radius: 8px;
    padding: 0 10px;
    border: 1.5px solid transparent;
    transition: border-color 0.2s;
}
.nav-input-field:focus-within {
    border-color: var(--primary);
    background: #fff;
}
.nav-input-field input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 9px 4px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
}
.nav-input-field input::placeholder {
    color: var(--text-muted);
}
.nav-input-field button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    color: var(--text-muted);
    transition: color 0.2s;
    flex-shrink: 0;
}
.nav-input-field button:hover {
    color: var(--primary);
}

/* 交换按钮 */
.nav-swap-btn {
    position: absolute;
    left: -2px;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #ddd;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #888;
    z-index: 2;
    transition: all 0.2s;
}
.nav-swap-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ===== 搜索建议列表 ===== */
.nav-suggest-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    max-height: 240px;
    overflow-y: auto;
    z-index: 1011;
}
.nav-suggest-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
}
.nav-suggest-item:hover {
    background: var(--bg-light);
}
.nav-suggest-item:last-child {
    border-bottom: none;
}
.nav-suggest-name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}
.nav-suggest-addr {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== 规划按钮 ===== */
.nav-plan-btn {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}
.nav-plan-btn:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}
.nav-plan-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== 路线结果面板 ===== */
.nav-route-result {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1010;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.1);
    max-height: 60vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.35s ease;
}
.nav-route-result.show {
    transform: translateY(0);
}
.nav-result-drag {
    width: 36px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 8px auto;
    cursor: grab;
}
.nav-result-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
}
.nav-result-tab {
    flex: 1;
    padding: 10px 0;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.nav-result-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.nav-result-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* ===== 路线概览 ===== */
.nav-route-overview {
    padding: 14px;
}
.nav-route-main {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.nav-route-points {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}
.nav-route-point {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}
.nav-route-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
}
.nav-route-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
.nav-stat-card {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
}
.nav-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}
.nav-stat-value.time {
    color: #e67e22;
}
.nav-stat-value.fee {
    color: #e74c3c;
}
.nav-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* 路线策略 */
.nav-route-strategies {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}
.nav-strategy-btn {
    flex: 1;
    padding: 8px 4px;
    border: 1.5px solid #e8e8e8;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    font-size: 12px;
    color: var(--text-secondary);
}
.nav-strategy-btn.active {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.08);
    color: var(--primary);
    font-weight: 600;
}
.nav-strategy-btn:hover:not(.active) {
    border-color: #ccc;
}

/* ===== 路线步骤列表 ===== */
.nav-steps-list {
    padding: 0 14px 14px;
}
.nav-step-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}
.nav-step-item:last-child {
    border-bottom: none;
}
.nav-step-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}
.nav-step-content {
    flex: 1;
    min-width: 0;
}
.nav-step-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
}
.nav-step-distance {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== 底部操作栏 ===== */
.nav-bottom-actions {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid #eee;
    background: #fff;
}
.nav-action-btn {
    flex: 1;
    padding: 10px 8px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s;
}
.nav-action-btn.save {
    background: var(--gradient-primary);
    color: #fff;
}
.nav-action-btn.save:hover { opacity: 0.9; }
.nav-action-btn.share {
    background: #52c41a;
    color: #fff;
}
.nav-action-btn.share:hover { background: #45a83a; }
.nav-action-btn.nav-amap {
    background: #1890ff;
    color: #fff;
}
.nav-action-btn.nav-amap:hover { background: #096dd9; }
.nav-action-btn.close-result {
    background: var(--bg-light);
    color: var(--text-secondary);
    flex: 0.5;
}
.nav-action-btn.close-result:hover { background: #e8e8e8; }

/* ===== 已保存路线面板 ===== */
.nav-saved-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    background: #fff;
    z-index: 1020;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}
.nav-saved-panel.show {
    transform: translateX(0);
}
.nav-saved-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1019;
    display: none;
}
.nav-saved-overlay.show {
    display: block;
}
.nav-saved-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}
.nav-saved-header h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}
.nav-saved-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}
.nav-saved-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #f0f0f0;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.nav-saved-item:hover {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.04);
}
.nav-saved-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.nav-saved-item-info {
    flex: 1;
    min-width: 0;
}
.nav-saved-item-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-saved-item-detail {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}
.nav-saved-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.nav-saved-item-actions button {
    padding: 4px 8px;
    font-size: 11px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.nav-saved-item-actions .load-btn {
    background: var(--primary);
    color: #fff;
}
.nav-saved-item-actions .del-btn {
    background: #f5f5f5;
    color: #999;
}
.nav-saved-item-actions .del-btn:hover {
    background: #fdd;
    color: #e74c3c;
}
.nav-saved-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.nav-saved-empty .empty-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

/* ===== 路线标记 ===== */
.nav-route-marker {
    position: relative;
}
.nav-marker-label {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* ===== 分享弹窗 ===== */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}
.share-modal-content {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 380px;
    overflow: hidden;
    animation: modalPopIn 0.25s ease;
}
.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}
.share-modal-header h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}
.share-modal-body {
    padding: 16px;
}
.share-preview-card {
    background: var(--bg-light);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 14px;
}
.share-preview-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.share-preview-route {
    font-size: 13px;
    color: var(--text-secondary);
}
.share-preview-stats {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}
.share-link-input {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.share-link-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid #e8e8e8;
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    background: #fafafa;
    outline: none;
}
.share-link-input input:focus {
    border-color: var(--primary);
}
.share-methods {
    display: flex;
    justify-content: center;
    gap: 20px;
}
.share-method-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}
.share-method-btn:hover {
    background: var(--bg-light);
}
.share-method-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.share-method-icon.wechat { background: #07c160; }
.share-method-icon.weibo { background: #e6162d; }
.share-method-icon.qq { background: #4cafe9; }
.share-method-icon.link { background: var(--primary); }
.share-method-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
    .nav-search-panel {
        padding: 8px 10px;
    }
    .nav-route-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    .nav-stat-value {
        font-size: 16px;
    }
    .nav-saved-panel {
        width: 100%;
        max-width: 100vw;
    }
}
