/* ===== 珞珈智行 · 旅行向导设计系统 ===== */

:root {
    /* 珞珈秋色 · 朱红（老斋舍砖墙）/ 深绿（珞珈山林）/ 米白（民国纸张） */
    --cherry: #8B3A3A;        /* 朱红主色 */
    --cherry-deep: #6B2828;   /* 深朱红 */
    --cherry-soft: #F5EFE8;   /* 米白底（替代粉色淡背景） */
    --cherry-tint: rgba(139, 58, 58, 0.12);

    /* Ink & Paper */
    --ink: #1A1A1A;           /* 墨黑（加深，提升对比度） */
    --ink-soft: #5C5751;      /* 暖灰 */
    --ink-light: #9B9590;     /* 暖浅灰 */
    --paper: #F5F1E8;         /* 民国纸张米白 */
    --surface: #FFFFFF;

    /* Jade · 珞珈山林深绿 */
    --jade: #2C5F2D;
    --jade-deep: #1F4520;
    --jade-soft: #E8EFE8;

    /* Warm neutrals */
    --stone: #D8D2C8;         /* 暖石色 */
    --divider: #E8E2D5;       /* 米白分隔 */

    /* Route colors */
    --color-recommended: #8B3A3A;   /* 朱红路线 */
    --color-shortest: #9B9590;     /* 暖灰最短路径 */
    --color-poi: #B68948;          /* 古铜金 POI 标注 */

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;

    /* Shadows */
    --shadow-sm: 0 1px 4px rgba(45, 45, 45, 0.04);
    --shadow-md: 0 4px 20px rgba(45, 45, 45, 0.06);
    --shadow-lg: 0 8px 40px rgba(45, 45, 45, 0.08);
    --shadow-float: 0 12px 60px rgba(45, 45, 45, 0.12);

    /* Touch */
    --touch-min: 44px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: #1a1a1a;
    height: 100vh;
    display: grid;
    grid-template-columns: 360px 1fr;
    grid-template-rows: 1fr;
    overflow: hidden;
}

/* ==============================
   MAP PANEL — edge-to-edge
   ============================== */
.map-panel {
    position: relative;
    background: #E8E5E1;
    overflow: hidden;
    order: 2;
}

.map-container {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}

.map-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #EAE7E2;
    color: var(--ink-soft);
    font-size: 0.9rem;
    z-index: 1;
}

.placeholder-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--stone);
    border-top-color: var(--cherry);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Map legend — floating overlay */
.map-legend {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 14px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    font-size: 0.72rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 10;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-soft);
}

.legend-line {
    width: 22px;
    height: 3px;
    border-radius: 2px;
}

.legend-line.recommended { background: var(--color-recommended); }
.legend-line.road-closure {
    background: #C0392B;
    height: 5px;
    width: 24px;
}

.legend-line.road-slow {
    height: 5px;
    width: 24px;
    background: repeating-linear-gradient(
        90deg,
        #D97706 0,
        #D97706 7px,
        transparent 7px,
        transparent 12px
    );
}

.legend-line.road-info,
.legend-line.road-unknown {
    height: 5px;
    width: 24px;
    background: repeating-linear-gradient(
        90deg,
        #2878A8 0,
        #2878A8 3px,
        transparent 3px,
        transparent 7px
    );
}

.legend-line.road-unknown {
    background: repeating-linear-gradient(
        90deg,
        #6B7280 0,
        #6B7280 3px,
        transparent 3px,
        transparent 7px
    );
}

.legend-line.shortest {
    background: repeating-linear-gradient(
        90deg,
        var(--color-shortest) 0,
        var(--color-shortest) 4px,
        transparent 4px,
        transparent 8px
    );
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.legend-dot.poi { background: var(--color-poi); }

/* Map point picking controls — compact campus palette, real touch buttons. */
.whu-locate-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 7px;
    border: 1px solid rgba(64, 53, 43, 0.12);
    border-radius: 18px;
    background: rgba(255, 253, 249, 0.94);
    box-shadow: 0 8px 24px rgba(35, 31, 27, 0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.whu-point-btn {
    --point-color: var(--jade-deep);
    appearance: none;
    width: 88px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 10px;
    border: 1px solid rgba(44, 95, 45, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--point-color);
    box-shadow: 0 2px 5px rgba(35, 31, 27, 0.07);
    font: inherit;
    cursor: pointer;
    touch-action: manipulation;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.whu-point-btn--via { --point-color: #89520D; border-color: rgba(137, 82, 13, 0.2); }
.whu-point-btn--end { --point-color: var(--cherry-deep); border-color: rgba(107, 40, 40, 0.2); }
.whu-point-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(35, 31, 27, 0.13); }
.whu-point-btn:active { transform: scale(0.97); }
.whu-point-btn:focus-visible { outline: 3px solid #276E8A; outline-offset: 2px; }
.whu-point-btn.is-picking {
    border-color: var(--point-color);
    background: var(--point-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(35, 31, 27, 0.24);
}

.whu-point-icon {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    border: 2px solid currentColor;
    border-radius: 50%;
    position: relative;
}
.whu-point-btn--start .whu-point-icon::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: currentColor;
}
.whu-point-btn--via .whu-point-icon { width: 11px; height: 11px; flex-basis: 11px; border-radius: 3px; transform: rotate(45deg); }
.whu-point-btn--end .whu-point-icon { border-radius: 4px; }
.whu-point-label { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.02em; }

.whu-point-popup {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 150px;
    color: var(--ink, #302B27);
}
.whu-point-delete {
    min-height: 42px;
    padding: 7px 11px;
    border: 1px solid rgba(107, 40, 40, 0.2);
    border-radius: 9px;
    background: #FFF8F5;
    color: var(--cherry-deep, #6B2828);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}
.whu-point-delete:hover { background: #F7E8E2; }
.whu-point-delete:focus-visible { outline: 3px solid #276E8A; outline-offset: 2px; }

/* ==============================
   CHAT PANEL — frosted glass
   ============================== */
.chat-panel {
    display: flex;
    flex-direction: column;
    background: rgba(250, 248, 245, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 0.5px solid rgba(0,0,0,0.08);
    order: 1;
    position: relative;
    z-index: 2;
    box-shadow: 2px 0 40px rgba(0,0,0,0.06);
    overflow: hidden;
    container-type: inline-size;
    container-name: chat-panel;
}

/* ===== Floating Header ===== */
.floating-header {
    padding: 10px 18px 8px;
    padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
    border-bottom: 0.5px solid rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-title {
    font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.02em;
}

.title-icon { font-size: 0.9rem; }

.header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-tagline {
    display: none;
}

/* 实时天气徽章 */
.weather-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink-soft);
    background: rgba(255, 255, 255, 0.75);
    border: 1.5px solid var(--stone);
    white-space: nowrap;
    cursor: default;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}
.weather-badge:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
}
.weather-badge #weather-icon {
    font-size: 1rem;
    line-height: 1;
}
.weather-badge.weather-slippery {
    background: rgba(66, 133, 244, 0.18);
    border-color: #4285f4;
    color: #1a56c4;
}
.weather-badge.weather-hot {
    background: rgba(230, 120, 50, 0.18);
    border-color: #e07832;
    color: #c0531c;
}

.help-btn,
.reset-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--stone);
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.help-btn:hover,
.reset-btn:hover {
    border-color: var(--cherry);
    background: var(--cherry-soft);
    color: var(--cherry-deep);
}
.reset-btn {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 12px;
    font-size: 0.76rem;
    font-weight: 700;
    touch-action: manipulation;
}
.reset-btn:focus-visible { outline: 3px solid #276E8A; outline-offset: 2px; }

/* ===== Mode bar（出行方式分段选择器，固定不随消息滚动） ===== */
.mode-bar {
    flex-shrink: 0;
    padding: 8px 22px 6px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.05);
    background: rgba(250, 248, 245, 0.65);
    transition: background 0.3s ease;
}
/* 模式色渗透：选中不同出行方式时，模式栏底色变化（肉眼可辨） */
.mode-bar.mode-walk  { background: rgba(232, 146, 156, 0.15); }
.mode-bar.mode-bike  { background: rgba(123, 163, 123, 0.15); }
.mode-bar.mode-drive { background: rgba(106, 159, 181, 0.15); }

/* ===== Chat Content (scrollable) ===== */
.chat-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}

/* Custom scrollbar */
.chat-content::-webkit-scrollbar { width: 4px; }
.chat-content::-webkit-scrollbar-track { background: transparent; }
.chat-content::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 2px;
}

/* ===== Welcome bubble ===== */
.welcome-bubble {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: bubble-in 0.5s ease-out;
}

@keyframes bubble-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.bubble-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cherry-soft), #E8DCC8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    border: 1px solid var(--stone);
}

.bubble-body {
    background: var(--surface);
    border-radius: 16px 16px 16px 4px;
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
    max-width: 340px;
}

.bubble-greeting {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--ink);
    margin-bottom: 4px;
}

.bubble-text {
    font-size: 0.82rem;
    color: var(--ink-soft);
    line-height: 1.65;
}

/* ===== Quick chips ===== */
.quick-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--surface);
    border: 1.5px solid var(--stone);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.quick-chip:hover,
.quick-chip.active {
    border-color: var(--cherry);
    background: var(--cherry-soft);
    color: var(--cherry-deep);
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(139, 58, 58, 0.18);
}

.quick-chip:active { transform: scale(0.96); }

.chip-emoji { font-size: 0.95rem; }

/* 驾车模式隐藏"平坦优先"快捷 chip（驾车不关心坡度） */
.quick-chips.is-drive .quick-chip[data-mode="slope_avoid"] { display: none; }

/* ===== Travel mode segmented control（步行 / 骑行 / 驾车） ===== */
.travel-mode-switch {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--divider);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.travel-mode-btn {
        flex: 1 1 0;
        min-width: 0;
        min-height: 44px;
        padding: 8px 4px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-soft);
    font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
    font-size: 0.95rem;   /* ≥15px，大字号不挤 */
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    transition: background 0.22s ease, color 0.22s ease, box-shadow 0.22s ease, transform 0.15s ease;
}

.travel-mode-btn:hover { background: rgba(255, 255, 255, 0.85); }

.travel-mode-btn:focus-visible {
    outline: 2px solid var(--cherry);
    outline-offset: 2px;
}

.travel-mode-btn.active {
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}
.travel-mode-btn.active[data-travel-mode="walk"]  { background: var(--cherry); }
.travel-mode-btn.active[data-travel-mode="bike"]  { background: var(--jade-deep); }
.travel-mode-btn.active[data-travel-mode="drive"] { background: #326C82; }

.travel-mode-btn:active { transform: scale(0.97); }

/* ===== Route strategy segmented control（仅在已有路线时出现） ===== */
.route-strategy-switch {
    display: flex;
    gap: 6px;
    margin-top: 7px;
}

.route-strategy-switch[hidden] { display: none; }

.route-strategy-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding: 7px 8px;
    border: 1px solid rgba(139, 58, 58, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    color: var(--ink-soft);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

.route-strategy-btn:hover {
    border-color: var(--cherry);
    background: rgba(255, 255, 255, 0.9);
}

.route-strategy-btn:focus-visible {
    outline: 2px solid var(--cherry);
    outline-offset: 2px;
}

.route-strategy-btn.active {
    border-color: var(--cherry-deep);
    background: var(--cherry-deep);
    color: #fff;
    box-shadow: 0 2px 8px rgba(107, 40, 40, 0.2);
}

.route-strategy-btn:active { transform: scale(0.97); }

.route-strategy-switch.is-drive .route-strategy-btn[data-route-strategy="flat"] {
    display: none;
}

/* ===== Mini shortcut cards row ===== */
.shortcut-cards-row {
    display: flex;
    gap: 8px;
}

.mini-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--stone);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-align: left;
    min-width: 0;
    min-height: 52px;
}

.mini-card:focus-visible,
.shortcut-card:focus-visible,
.quick-chip:focus-visible {
    outline: 3px solid #276E8A;
    outline-offset: 2px;
}

.mini-card:hover {
    border-color: var(--cherry);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(139, 58, 58, 0.15);
}

.mini-card-icon { font-size: 1.1rem; flex-shrink: 0; }

.mini-card-text {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.3;
}

.mini-card.sc-accent { border-left: 3px solid var(--cherry-deep); }
.mini-card.sc-pink { border-left: 3px solid var(--cherry); }

/* ===== Results ===== */
.results-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: result-in 0.45s ease-out;
}
.results-section[hidden] { display: none !important; }

/* ===== Device-specific product modes ===== */
.desktop-only,
.navigation-only {
    display: none !important;
}

body.is-navigation-mode .navigation-only {
    display: flex !important;
}

body.is-planning-mode .desktop-mode-card {
    display: flex !important;
}

body.is-planning-mode .desktop-route-workbench {
    display: flex !important;
}

.desktop-mode-card {
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(44, 95, 45, 0.2);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(232, 239, 232, 0.96), rgba(245, 241, 232, 0.96));
    box-shadow: var(--shadow-sm);
}

.desktop-mode-card__icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 5px rgba(44, 95, 45, 0.12);
}

.desktop-mode-card__body {
    min-width: 0;
    flex: 1;
}

.desktop-mode-card__body strong {
    display: block;
    margin-bottom: 3px;
    color: var(--jade-deep);
    font-size: 0.84rem;
}

.desktop-mode-card__body p {
    color: var(--ink-soft);
    font-size: 0.74rem;
    line-height: 1.55;
}

.desktop-mode-card__status {
    flex: 0 0 auto;
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(44, 95, 45, 0.1);
    color: var(--jade-deep);
    font-size: 0.64rem;
    font-weight: 700;
    white-space: nowrap;
}

.desktop-route-steps {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 235px;
    overflow-y: auto;
    list-style: none;
}

.desktop-route-step__button {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    width: 100%;
    padding: 8px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: inherit;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.desktop-route-step__button:hover,
.desktop-route-step.is-active .desktop-route-step__button {
    border-color: rgba(139, 58, 58, 0.16);
    background: var(--cherry-soft);
}

.desktop-route-step__button:disabled {
    cursor: default;
}

.desktop-route-step__index {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    margin-top: 1px;
    border-radius: 50%;
    background: var(--cherry-deep);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 700;
}

.desktop-route-step__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.desktop-route-step__body strong {
    color: var(--ink);
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.45;
}

.desktop-route-step__body small,
.desktop-route-step--empty {
    color: var(--ink-light);
    font-size: 0.65rem;
    line-height: 1.45;
}

.desktop-route-step--empty {
    padding: 9px;
}

.desktop-route-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 12px;
}

.desktop-route-action {
    min-height: 38px;
    padding: 7px 9px;
    border: 1px solid var(--stone);
    border-radius: 10px;
    background: #fff;
    color: var(--ink-soft);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
}

.desktop-route-action--primary {
    border-color: var(--cherry-deep);
    background: var(--cherry-deep);
    color: #fff;
}

.desktop-route-action.is-copied {
    border-color: var(--jade);
    background: var(--jade-soft);
    color: var(--jade-deep);
}

.desktop-route-workbench__hint {
    margin-top: 8px;
    color: var(--ink-light);
    font-size: 0.64rem;
    line-height: 1.5;
}

@keyframes result-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Route summary cards */
.route-summary {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 14px 6px;
    box-shadow: var(--shadow-sm);
}

.summary-card { text-align: center; flex: 1; min-width: 0; padding: 0 2px; }

.summary-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--cherry-deep);
    font-variant-numeric: tabular-nums;
}

/* 预计用时数字色随出行方式变化 */
.summary-card[data-mode-color="walk"]  .summary-value { color: #C66E78; }
.summary-card[data-mode-color="bike"]  .summary-value { color: #4E8051; }
.summary-card[data-mode-color="drive"] .summary-value { color: #4A7A8E; }

.summary-label {
    font-size: 0.7rem;
    color: var(--ink-soft);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.summary-divider {
    width: 1px;
    height: 30px;
    background: var(--divider);
}

/* Section label */
.section-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

/* POI tags */
.poi-section { margin-top: 2px; }

.poi-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.poi-tags li {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--cherry-soft);
    color: var(--cherry-deep);
    border-radius: 16px;
    font-size: 0.78rem;
    font-weight: 500;
}

/* Explanation card — 左边框色随出行方式变化 */
.explanation-box {
    background: linear-gradient(135deg, var(--cherry-soft) 0%, var(--jade-soft) 100%);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    border-left: 3px solid var(--cherry);
    transition: border-color 0.3s ease;
}
.explanation-box.mode-walk  { border-left-color: #E8929C; }
.explanation-box.mode-bike  { border-left-color: #7BA37B; }
.explanation-box.mode-drive { border-left-color: #6A9FB5; }

.explanation-box p {
    font-size: 0.88rem;
    line-height: 1.75;
    color: var(--ink);
}

.road-conditions-notice {
    margin-top: 8px;
    padding: 6px 10px;
    background: #FFF3E0;
    border-left: 2px solid #E67E22;
    border-radius: 4px;
    font-size: 0.82rem;
    color: #D35400;
}

.road-condition-update-notice {
    margin-top: 8px;
    padding: 8px 10px;
    background: #EAF2F1;
    border-left: 3px solid #4F8275;
    border-radius: 4px;
    color: #315B51;
    font-size: 0.84rem;
    line-height: 1.5;
}

.road-condition-update-notice button {
    margin-left: 8px;
    padding: 4px 9px;
    border: 1px solid #4F8275;
    border-radius: 999px;
    background: #fff;
    color: #315B51;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

/* Follow-up suggestions */
.suggestions-area {
    padding-top: 8px;
}

.suggestions-prompt {
    font-size: 0.76rem;
    color: var(--ink-light);
    margin-bottom: 8px;
}

.suggestions-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.suggestion-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    background: var(--surface);
    border: 1.5px solid var(--stone);
    border-radius: 18px;
    font-size: 0.78rem;
    color: var(--ink);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.suggestion-chip:hover {
    border-color: var(--cherry);
    background: var(--cherry-soft);
    color: var(--cherry-deep);
    transform: translateY(-1px);
}

.suggestion-chip:active { transform: scale(0.96); }

/* ===== Chat input bar ===== */
.chat-input-bar {
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    border-top: 0.5px solid rgba(0,0,0,0.06);
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 0;
    position: relative;
}

.nl-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 0.9rem;
    font-family: inherit;
    border: 1.5px solid var(--stone);
    border-radius: 20px;
    resize: none;
    color: var(--ink);
    background: var(--surface);
    transition: border-color 0.25s, box-shadow 0.25s;
    line-height: 1.5;
    max-height: 100px;
}

.nl-input::placeholder { color: var(--ink-light); }

.nl-input:focus {
    border-color: var(--cherry);
    box-shadow: 0 0 0 3px var(--cherry-tint);
}

.submit-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cherry), var(--cherry-deep));
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.25s, opacity 0.2s;
    box-shadow: 0 2px 10px rgba(107, 40, 40, 0.32);
    flex-shrink: 0;
}

.submit-btn:hover {
    box-shadow: 0 4px 18px rgba(107, 40, 40, 0.42);
    transform: scale(1.05);
}

.submit-btn:active { transform: scale(0.95); }

.submit-btn:disabled { opacity: 0.5; transform: none; cursor: not-allowed; }

.input-counter {
    position: absolute;
    top: -20px;
    right: 60px;
    font-size: 0.68rem;
    color: var(--ink-light);
    pointer-events: none;
}

/* ===== Keyboard hint bar (desktop only) ===== */
.kbd-hint-bar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 16px 8px;
    font-size: 0.7rem;
    color: var(--ink-light);
}

.kbd-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.kbd-label {
    margin-right: 8px;
}
.kbd-row .kbd-label:last-child {
    margin-right: 0;
}

.kbd-hint-bar kbd {
    display: inline-block;
    padding: 1px 5px;
    font-size: 0.65rem;
    font-family: inherit;
    border: 1px solid var(--stone);
    border-radius: 4px;
    background: rgba(255,255,255,0.6);
    color: var(--ink-light);
    line-height: 1.3;
}

/* 可点击的快捷键（data-kbd）：鼠标直接点就能触发，不依赖键盘焦点 */
.kbd-hint-bar kbd[data-kbd] {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.kbd-hint-bar kbd[data-kbd]:hover {
    background: var(--cherry);
    border-color: var(--cherry);
    color: #fff;
}
.kbd-hint-bar kbd[data-kbd]:active {
    transform: scale(0.92);
}

/* ===== Loading overlay ===== */
.loading-section {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.loading-section[hidden] { display: none !important; }

.loading-overlay { text-align: center; }

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: var(--cherry);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin: 0 auto 16px;
}

.loading-text {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
    transition: opacity 0.3s ease;
}

.loading-subtext {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
    transition: opacity 0.3s ease;
}

.loading-text.fade,
.loading-subtext.fade { opacity: 0; }

/* ===== Error modal ===== */
.error-section {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.error-section[hidden] { display: none !important; }

.error-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    text-align: center;
    max-width: 320px;
    width: 100%;
    box-shadow: var(--shadow-float);
    animation: error-in 0.25s ease-out;
}

@keyframes error-in {
    from { opacity: 0; transform: translateY(-20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.error-icon { font-size: 2.5rem; margin-bottom: 8px; }

.error-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 6px;
}

.error-message {
    font-size: 0.85rem;
    color: var(--ink-soft);
    line-height: 1.6;
    margin-bottom: 18px;
}

.error-close-btn {
    min-height: 40px;
    padding: 10px 32px;
    background: linear-gradient(135deg, var(--cherry), var(--cherry-deep));
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
}

.error-close-btn:hover {
    box-shadow: 0 4px 14px rgba(107, 40, 40, 0.35);
}

.error-close-btn:active { transform: scale(0.97); }

/* ==============================
   WELCOME OVERLAY (unchanged)
   ============================== */
.welcome-overlay { /* ... kept from original for welcome card compatibility ... */ }

.mobile-panel-resizer { display: none; }

/* ==============================
   RESPONSIVE: Mobile (<768px)
   ============================== */
@media (max-width: 767px) {
    body {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, var(--mobile-map-pane-height, 55vh)) minmax(0, 1fr);
        height: 100dvh;
    }

    .map-panel { order: 1; }

    .chat-panel {
        order: 2;
        border-right: none;
        border-top: 0.5px solid rgba(0,0,0,0.08);
        border-radius: 20px 20px 0 0;
        margin-top: -16px;
        box-shadow: 0 -8px 40px rgba(0,0,0,0.08);
    }

    .mobile-panel-resizer {
        flex: 0 0 48px;
        height: 48px;
        display: grid;
        place-items: center;
        position: relative;
        z-index: 3;
        margin-top: 0;
        margin-bottom: -28px;
        touch-action: none;
        user-select: none;
        -webkit-user-select: none;
        -webkit-tap-highlight-color: transparent;
        cursor: ns-resize;
    }

    .mobile-panel-resizer::before {
        content: "";
        position: absolute;
        inset: -4px 0;
    }

    .mobile-panel-resizer span {
        width: 42px;
        height: 4px;
        border-radius: 999px;
        background: #9B9590;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
        transform: translateY(-14px);
        transition: width 0.16s ease, background 0.16s ease;
    }

    .mobile-panel-resizer:focus-visible {
        outline: 3px solid #276E8A;
        outline-offset: -2px;
        border-radius: 12px;
    }

    .mobile-panel-resizer:focus-visible span,
    body.is-resizing-mobile-panels .mobile-panel-resizer span {
        width: 54px;
        background: var(--cherry);
    }

    body.is-resizing-mobile-panels,
    body.is-resizing-mobile-panels * {
        cursor: ns-resize !important;
        user-select: none !important;
        -webkit-user-select: none !important;
    }

    .floating-header { padding: 14px 18px 10px; }

    .header-tagline { display: none; }

    .mode-bar { padding: 8px 16px; }

    .chat-content { padding: 12px 16px; gap: 10px; }

    .bubble-body { max-width: 280px; }

    /* 4 张摘要卡在手机端 2×2 自适应，不挤压不出界 */
    .route-summary { flex-wrap: wrap; row-gap: 12px; padding: 12px 8px; }
    .summary-divider { display: none; }
    .summary-card { flex: 1 1 44%; }
    .summary-value { font-size: 1.05rem; }
    .summary-label { font-size: 0.68rem; }

    .chat-input-bar { padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); }

    .nl-input { font-size: 0.85rem; padding: 10px 14px; }

    .submit-btn { width: 40px; height: 40px; }

    .map-legend { bottom: 10px; right: 10px; padding: 8px 10px; font-size: 0.68rem; }

    .whu-locate-group { flex-direction: column; gap: 4px; padding: 4px; border-radius: 13px; }
    .whu-point-btn { width: 52px; min-height: 44px; padding: 0 2px; border-radius: 9px; }
    .whu-point-icon { display: none; }
    .whu-point-label { font-size: 0.74rem; }
    .route-strategy-switch { gap: 5px; }
    .route-strategy-btn { font-size: 0.76rem; padding-inline: 5px; }

    /* 移动端没人用键盘快捷键，隐藏 */
    .kbd-hint-bar { display: none; }
}

/* ==============================
   RESPONSIVE: Large desktop (≥1200px)
   ============================== */
@media (min-width: 1200px) {
    body { grid-template-columns: 380px 1fr; }

    .mode-bar { padding: 10px 28px 8px; }

    .chat-content { padding: 20px 28px; }

    .bubble-body { max-width: 400px; }
    .chat-bubble-body { max-width: 400px; }
}

/* ==============================
   WELCOME OVERLAY (冷启动欢迎卡片)
   ============================== */
.welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.welcome-overlay.hidden { display: none !important; }

.welcome-mask {
    position: absolute;
    inset: 0;
    background: rgba(45, 45, 45, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.welcome-card {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 440px;
    max-width: 92vw;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: var(--shadow-float);
    padding: 0;
    z-index: 1;
    animation: welcome-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes welcome-in {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.welcome-card-topbar {
    height: 48px;
    background: linear-gradient(
        135deg,
        var(--cherry-soft) 0%,
        var(--cherry) 40%,
        var(--jade-soft) 100%
    );
    position: relative;
}
.welcome-card-topbar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 24px,
        rgba(255,255,255,0.25) 24px,
        rgba(255,255,255,0.25) 26px
    );
}

.welcome-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.85);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s;
}
.welcome-close:hover { background: white; }

.welcome-header {
    padding: 20px 24px 12px;
    text-align: center;
}
.welcome-title {
    font-family: "Noto Serif SC", serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ink);
}
.welcome-subtitle {
    font-size: 0.8rem;
    color: var(--ink-soft);
    margin-top: 4px;
}

.welcome-shortcuts {
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.shortcut-card {
    padding: 14px 10px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--stone);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-align: center;
    min-height: 64px;
}
.shortcut-card:hover {
    border-color: var(--cherry);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(139, 58, 58, 0.18);
}
.shortcut-card:nth-child(1),
.shortcut-card:nth-child(2),
.shortcut-card:nth-child(3) { grid-column: span 1; }
.shortcut-card:nth-child(4),
.shortcut-card:nth-child(5) { grid-column: span 1; }

.sc-emoji { font-size: 1.4rem; }
.sc-name { font-weight: 600; font-size: 0.85rem; color: var(--ink); }
.sc-desc { font-size: 0.7rem; color: var(--ink-soft); line-height: 1.3; }

.sc-accent { border-left: 3px solid var(--cherry-deep); }
.sc-pink { border-left: 3px solid var(--cherry); }
.sc-jade { border-left: 3px solid var(--jade); }
.sc-stone { border-left: 3px solid var(--ink-light); }
.sc-wide { border-left: 3px solid var(--color-poi); }

/* Welcome tips */
.welcome-tips {
    padding: 14px 24px;
    border-top: 1px solid var(--divider);
    margin-top: 12px;
}

.welcome-tips-summary {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-soft);
    cursor: pointer;
    padding: 4px 0;
}

.tip-item {
    display: flex;
    gap: 10px;
    padding: 6px 0;
    align-items: baseline;
}
.tip-num {
    font-size: 0.75rem;
    color: var(--cherry-deep);
    font-weight: 600;
    flex-shrink: 0;
}
.tip-text { font-size: 0.82rem; color: var(--ink-soft); line-height: 1.5; }

/* Welcome footer */
.welcome-footer {
    padding: 16px 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--divider);
}

.welcome-start {
    width: 100%;
    min-height: 46px;
    background: linear-gradient(135deg, var(--cherry), var(--cherry-deep));
    color: white;
    border: none;
    border-radius: 23px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
}
.welcome-start:hover {
    box-shadow: 0 4px 18px rgba(107, 40, 40, 0.38);
}
.welcome-start:active { transform: scale(0.98); }

.welcome-dont-show {
    font-size: 0.78rem;
    color: var(--ink-light);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

@media (max-width: 767px) {
    .welcome-card { width: 92vw; }
    .welcome-shortcuts { padding: 0 16px; gap: 8px; }
    .welcome-header { padding: 16px 16px 10px; }
    .welcome-tips { padding: 10px 16px; }
    .welcome-footer { padding: 12px 16px 16px; }
}

/* ===== 快捷键帮助弹窗 ===== */
.kbd-help-section {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.kbd-help-section[hidden] { display: none !important; }
.kbd-help-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 28px 24px 20px;
    max-width: 380px;
    width: 100%;
    box-shadow: var(--shadow-float);
    animation: error-in 0.25s ease-out;
}
.kbd-help-card h3 {
    font-family: "Noto Serif SC", serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.kbd-help-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}
.kbd-help-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--ink-soft);
}
.kbd-help-row kbd {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 5px;
    background: var(--cherry-soft);
    border: 0.5px solid var(--stone);
    font-family: -apple-system, "Segoe UI", monospace;
    font-size: 0.78rem;
    color: var(--cherry-deep);
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}
.kbd-help-close {
    width: 100%;
    min-height: 40px;
    background: linear-gradient(135deg, var(--cherry), var(--cherry-deep));
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s;
}
.kbd-help-close:active { transform: scale(0.97); }

/* ===== 上报路况弹窗 ===== */
.road-report-section {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.road-report-section[hidden] { display: none !important; }
.road-report-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-float);
    animation: error-in 0.25s ease-out;
}
.road-report-card h3 {
    font-family: "Noto Serif SC", serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 6px;
}
.road-report-desc {
    font-size: 0.8rem;
    color: var(--ink-light);
    margin-bottom: 16px;
}
#road-report-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
#road-report-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-soft);
}
#road-report-form select,
#road-report-form input {
    padding: 9px 12px;
    border: 1.5px solid var(--stone);
    border-radius: 10px;
    font-size: 0.9rem;
    background: var(--surface);
    color: var(--ink);
    outline: none;
    transition: border-color 0.15s;
}
#road-report-form select:focus,
#road-report-form input:focus {
    border-color: var(--cherry);
}
.rr-impact-settings {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--stone);
    border-radius: 12px;
    background: var(--surface);
}
.rr-impact-settings legend {
    padding: 0 5px;
    color: var(--ink);
    font-size: 0.85rem;
    font-weight: 700;
}
.rr-mode-title {
    color: var(--ink-soft);
    font-size: 0.82rem;
    font-weight: 600;
}
.rr-mode-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
#road-report-form .rr-mode-choice {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border: 1px solid var(--stone);
    border-radius: 999px;
    background: var(--surface);
    cursor: pointer;
}
#road-report-form .rr-mode-choice input {
    width: auto;
    margin: 0;
    accent-color: var(--cherry);
}
#rr-cost-wrap[hidden] {
    display: none;
}
.rr-time-row {
    display: flex;
    gap: 10px;
}
.rr-time-item {
    flex: 1;
    min-width: 0;
}
.rr-time-item input {
    width: 100%;
    box-sizing: border-box;
    font-size: 0.8rem;
    padding: 8px 9px;
}
.rr-time-hint {
    margin: -6px 0 0;
    font-size: 0.72rem;
    color: var(--ink-faint, #999);
    line-height: 1.5;
}
.road-report-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.rr-btn-primary, .rr-btn-secondary {
    flex: 1;
    min-height: 38px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.15s, opacity 0.15s;
}
.rr-btn-primary {
    background: linear-gradient(135deg, var(--cherry), var(--cherry-deep));
    color: white;
}
.rr-btn-secondary {
    background: var(--bg-soft);
    color: var(--ink-soft);
    border: 1.5px solid var(--stone);
}
.rr-btn-primary:active, .rr-btn-secondary:active { transform: scale(0.97); }
.rr-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.road-report-hint {
    margin-top: 12px;
    font-size: 0.78rem;
    color: var(--cherry-deep);
    min-height: 16px;
}
.road-report-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--stone);
    background: var(--surface);
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
}
.road-report-btn:hover { background: var(--bg-soft); transform: scale(1.08); }

/* ===== Chat bubbles ===== */
.chat-bubble-row {
    animation: bubble-in 0.4s ease-out;
}

.chat-bubble-reply {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.chat-bubble-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cherry-soft), #E8DCC8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    border: 1px solid var(--stone);
}

.chat-bubble-body {
    background: var(--surface);
    border-radius: 14px 14px 14px 4px;
    padding: 10px 14px;
    box-shadow: var(--shadow-sm);
    max-width: 340px;
}

.chat-bubble-text {
    font-size: 0.85rem;
    color: var(--ink);
    line-height: 1.65;
}

/* 用户气泡（靠右，主题色） */
.chat-bubble-user {
    display: flex;
    justify-content: flex-end;
}

.chat-bubble-user .chat-bubble-body {
    background: linear-gradient(135deg, var(--cherry), var(--cherry-deep));
    border-radius: 14px 14px 4px 14px;
    box-shadow: var(--shadow-sm);
    max-width: 260px;
}

.chat-bubble-user .chat-bubble-text {
    color: #fff;
}


/* ==============================
   PWA 安装引导横幅
   ============================== */
.install-banner {
    position: fixed;
    left: 50%;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    /* 显式宽度：不依赖 shrink-to-fit，防止个别内核把文本列塌成一字一行 */
    width: min(430px, calc(100vw - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    max-width: calc(100vw - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(158, 58, 75, 0.18);
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(120, 40, 50, 0.22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: install-banner-in 0.35s ease;
}
.install-banner[hidden] { display: none; }
@keyframes install-banner-in {
    from { opacity: 0; transform: translateX(-50%) translateY(16px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.install-banner__icon { font-size: 1.6rem; line-height: 1; }
.install-banner__text { flex: 1 1 auto; min-width: 0; }
.install-banner__title {
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-weight: 700; font-size: 0.92rem; color: #6B2828;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.install-banner__sub {
    font-size: 0.74rem; color: #A87880; margin-top: 1px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; overflow-wrap: anywhere;
}
.install-banner__btn {
    flex: 0 0 auto;
    border: none; border-radius: 999px;
    padding: 8px 18px;
    background: #E8929C; color: #fff;
    font-family: "Noto Serif SC", serif; font-weight: 600; font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(158, 58, 75, 0.3);
}
.install-banner__btn:active { transform: scale(0.96); }
.install-banner__close {
    flex: 0 0 auto;
    border: none; background: transparent;
    color: #B5B0AB; font-size: 0.9rem;
    cursor: pointer; padding: 4px 6px;
}

/* 刘海屏顶部安全区：聊天头部与模式条让出刘海 */
.chat-header, .mode-bar {
    padding-left: calc(22px + env(safe-area-inset-left, 0px));
    padding-right: calc(22px + env(safe-area-inset-right, 0px));
}

/* ================= Leaflet 地图适配（2026-09 高德→Leaflet 迁移） ================= */

/* divIcon 容器去掉 Leaflet 默认白底边框（包括老版本缓存样式的优先级） */
.whu-div-icon,
.leaflet-marker-icon.whu-div-icon {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
}

/* 蓝点平滑移动：GPS 更新时滑行到新位置而非瞬移（高德式"稳"的观感） */
/* 地图缩放动画期间必须禁用，否则 transform 被过渡拖住产生拖影 */
.leaflet-marker-icon.user-dot-smooth {
    transition: transform 0.7s ease-out;
}
.leaflet-zoom-anim .leaflet-marker-icon.user-dot-smooth {
    transition: none;
}

/* 地图上的胶囊标签：动态尺寸，用 transform 居中到锚点上方 */
.whu-map-pill {
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transform: translate(-50%, -120%);
}
.whu-map-pill-poi {
    background: #D4915C;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transform: translate(-50%, -120%);
}

/* GPS 定位按钮 */
.whu-locate-btn {
    width: 38px;
    height: 38px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-top: 10px;  /* 与上方图层切换控件留缝 */
    transition: background 0.15s ease;
    position: relative;
}
.whu-locate-btn:hover {
    background: #f5f2ee;
}
.whu-locate-icon {
    font-size: 20px;
    line-height: 1;
    color: #2B7CFF;
}
.whu-locate-btn.is-busy .whu-locate-icon {
    animation: whu-locate-pulse 1s ease-in-out infinite;
}
@keyframes whu-locate-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.82); }
}

/* Leaflet 控件与弹窗：圆角统一珞珈风格 */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
}
.leaflet-control-layers {
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18) !important;
}
/* 地图容器明确尺寸（Leaflet 初始化依赖），与高德时期视觉一致 */
#map-container {
    width: 100%;
    height: 100%;
}

/* ===== P4：候选卡片 / 澄清选项（珞珈秋色主题） ===== */
.candidate-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0 4px 36px;  /* 与回复气泡头像对齐 */
    max-width: 92%;
}
.candidate-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-height: var(--touch-min);
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    font-family: inherit;
    text-align: left;
}
.candidate-card:hover:not(:disabled) {
    border-color: var(--cherry);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.candidate-card:disabled {
    opacity: 0.55;
    cursor: default;
}
.candidate-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
}
.candidate-cat {
    font-size: 11px;
    color: var(--color-poi);
}
.candidate-campus {
    font-size: 11px;
    color: var(--ink-light);
}
.candidate-dist {
    font-size: 11px;
    color: var(--ink-light);
}

/* Read-only comparison stays in the conversation and never implies a route was selected. */
.route-comparison-row {
    padding: 3px 0 5px 44px;
    max-width: min(520px, 94%);
}
.route-comparison-card {
    width: 100%;
    padding: 12px 14px 10px;
    border: 1px solid var(--divider);
    border-left: 3px solid var(--cherry);
    border-radius: 3px 10px 10px 3px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.route-comparison-heading,
.route-comparison-option-primary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.route-comparison-heading { padding-bottom: 8px; }
.route-comparison-endpoints {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
}
.route-comparison-availability,
.route-comparison-unavailable-label {
    flex: 0 0 auto;
    color: var(--ink-light);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}
.route-comparison-option {
    padding: 8px 0 7px;
    border-top: 1px solid var(--divider);
}
.route-comparison-label {
    color: var(--ink);
    font-size: 11px;
    font-weight: 650;
}
.route-comparison-distance {
    color: var(--cherry);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.route-comparison-meta,
.route-comparison-note,
.route-comparison-empty {
    margin: 4px 0 0;
    color: var(--ink-light);
    font-size: 10px;
    line-height: 1.55;
}
.route-comparison-option.is-unavailable .route-comparison-label,
.route-comparison-option.is-unavailable .route-comparison-unavailable-label {
    color: var(--ink-light);
}
.route-comparison-empty {
    padding: 8px 0;
    border-top: 1px solid var(--divider);
}
.route-comparison-note {
    padding-top: 8px;
    border-top: 1px solid var(--divider);
}

.clarify-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0 4px 36px;
    max-width: 92%;
}
.clarify-chip {
    min-height: 36px;
    padding: 6px 16px;
    background: var(--cherry-tint);
    color: var(--cherry);
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.clarify-chip:hover:not(:disabled) {
    background: rgba(139, 58, 58, 0.2);
    border-color: var(--cherry);
}
.clarify-chip:disabled {
    opacity: 0.55;
    cursor: default;
}

/* ===== 定位状态指示器（页面上可见，排查微信环境问题） ===== */
.loc-status {
    position: fixed;
    top: 56px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
    transition: opacity 0.3s ease;
}
.loc-status--info {
    background: #4A6CF7;
    color: #fff;
}
.loc-status--success {
    background: #22C55E;
    color: #fff;
}
.loc-status--warn {
    background: #F59E0B;
    color: #fff;
}
.loc-status--error {
    background: #EF4444;
    color: #fff;
}

/* =====================================================================
   2026-09 实时导航 + 语音（珞珈秋色 · 高德同款沉浸导航态）
   ===================================================================== */

/* ---------- 结果区「开始导航」主按钮 ---------- */
.start-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 50px;
    margin: 12px 0 4px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--cherry), var(--cherry-deep));
    color: #fff;
    font-size: 1.02rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(107, 40, 40, 0.28);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.start-nav-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(107, 40, 40, 0.38);
}
.start-nav-btn:active { transform: translateY(0); }

/* ---------- 输入栏语音麦克风（按住说话） ---------- */
.voice-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid var(--stone);
    background: var(--surface);
    color: var(--cherry);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    touch-action: none;            /* 按住时不触发滚动/缩放手势 */
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
}
.voice-btn:hover { border-color: var(--cherry); }
.voice-btn.listening {
    background: #C0392B;
    border-color: #C0392B;
    color: #fff;
    transform: scale(1.06);
    animation: voice-pulse 1.2s ease-in-out infinite;
}
/* 上滑越过取消阈值：灰红收敛态，停止脉冲 */
.voice-btn.will-cancel {
    background: #8a8a8e;
    border-color: #8a8a8e;
    color: #fff;
    transform: scale(1);
    animation: none;
    box-shadow: none;
}
@keyframes voice-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.45); }
    50% { box-shadow: 0 0 0 10px rgba(192, 57, 43, 0); }
}

/* ---------- 按住说话 · 紧凑聆听浮层（输入栏上方的小胶囊卡） ---------- */
.voice-hold-card {
    position: fixed;
    left: 50%;
    bottom: calc(104px + env(safe-area-inset-bottom, 0px));
    transform: translate(-50%, 14px) scale(0.96);
    width: max-content;
    max-width: min(78vw, 300px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 18px 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 28px rgba(80, 30, 40, 0.18), 0 1px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(233, 109, 132, 0.25);
    opacity: 0;
    pointer-events: none;
    z-index: 1500;
    transition: opacity 0.16s ease, transform 0.16s ease;
}
.voice-hold-card.show {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}
.voice-hold-card .vhc-icon {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--cherry) 0%, var(--cherry-deep) 100%);
    box-shadow: 0 3px 10px rgba(192, 57, 43, 0.32);
    transition: transform 0.08s ease, background 0.18s ease;
}
.voice-hold-card .vhc-dot {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(233, 109, 132, 0.35);
    animation: vhc-ring 1.3s ease-out infinite;
    z-index: -1;
}
@keyframes vhc-ring {
    0%   { transform: scale(1);    opacity: 0.7; }
    70%  { transform: scale(1.55); opacity: 0; }
    100% { transform: scale(1.55); opacity: 0; }
}
.voice-hold-card .vhc-text {
    font-size: 13px;
    font-weight: 600;
    color: #5a2a33;
    line-height: 1.3;
}
.voice-hold-card .vhc-interim {
    font-size: 13px;
    line-height: 1.4;
    color: #333;
    text-align: center;
    max-width: 240px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    min-height: 0;
}
.voice-hold-card .vhc-interim:empty { display: none; }
.voice-hold-card .vhc-hint {
    font-size: 11px;
    color: #9a8a8e;
    letter-spacing: 0.5px;
    line-height: 1.2;
}
/* 取消态：变灰、提示红色 */
.voice-hold-card.cancel { border-color: rgba(150, 150, 150, 0.4); }
.voice-hold-card.cancel .vhc-icon {
    background: linear-gradient(135deg, #9a9a9e 0%, #7a7a7e 100%);
    box-shadow: 0 3px 10px rgba(110, 110, 110, 0.3);
}
.voice-hold-card.cancel .vhc-dot {
    background: rgba(150, 150, 150, 0.3);
    animation: none;
}
.voice-hold-card.cancel .vhc-text { color: #b3402f; }
.voice-hold-card.cancel .vhc-hint { color: #b3402f; }

/* 横屏矮窗口：卡片再往上收一点，避免压住输入栏 */
@media (max-height: 480px) {
    .voice-hold-card { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- 导航浮层容器（贴地图面板，不抢聊天面板） ---------- */
.nav-overlay {
    position: absolute;
    inset: 0;
    /* 必须高于 Leaflet 内部控件（zoom/选点组 z-index 1000），
       否则右上角「起点/途经/终点」会压在指令卡和退出按钮上 */
    z-index: 1200;
    pointer-events: none;
}
.nav-overlay[hidden] { display: none; }
.nav-overlay > * { pointer-events: auto; }

/* 导航中收起地图杂物：图例 / 缩放 / 图层 / 选点控件组 / 定位按钮 */
body.nav-running .map-legend { display: none; }
body.nav-running .leaflet-top.leaflet-left { opacity: 0; pointer-events: none; }
body.nav-running .leaflet-top.leaflet-right { opacity: 0; pointer-events: none; }
body.nav-running .whu-locate-btn { opacity: 0; pointer-events: none; }

/* ---------- 顶部大指令卡 ---------- */
.nav-card {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 14px 14px 16px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(30, 20, 15, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.nav-card__icon {
    position: relative;
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cherry), var(--cherry-deep));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(107, 40, 40, 0.35);
}
.nav-card__arrow {
    width: 32px;
    height: 32px;
    fill: #fff;
    transition: transform 0.25s ease;
}
.nav-card__emoji {
    font-size: 28px;
    line-height: 1;
}
.nav-card__body { flex: 1 1 auto; min-width: 0; }
.nav-card__dist {
    font-size: 13px;
    font-weight: 600;
    color: var(--cherry);
    line-height: 1.3;
    min-height: 17px;
}
.nav-card__main {
    font-size: 1.28rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-card__sub {
    font-size: 0.86rem;
    color: var(--ink-soft);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-card__exit {
    flex: 0 0 auto;
    /* 44px：移动端推荐最小触摸目标，右上角退出必须好按 */
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--cherry-soft);
    color: var(--cherry-deep);
    font-size: 17px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.nav-card__exit:active { background: var(--cherry-tint); }

/* ---------- GPS 弱网黄条 ---------- */
.nav-gps-warn {
    position: absolute;
    top: calc(106px + env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 16px;
    background: rgba(245, 158, 11, 0.95);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 3px 12px rgba(180, 110, 0, 0.35);
}
.nav-gps-warn[hidden] { display: none; }

/* ---------- 重居中按钮 ---------- */
.nav-recenter {
    position: absolute;
    right: 14px;
    bottom: 108px;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: var(--cherry);
    box-shadow: 0 4px 16px rgba(30, 20, 15, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: recenter-in 0.2s ease;
}
@keyframes recenter-in {
    from { opacity: 0; transform: scale(0.7); }
    to { opacity: 1; transform: scale(1); }
}

/* ---------- 轻提示 toast ---------- */
.nav-toast {
    position: absolute;
    top: 32%;
    left: 50%;
    transform: translateX(-50%);
    padding: 9px 20px;
    background: rgba(30, 25, 20, 0.82);
    color: #fff;
    font-size: 14px;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}
.nav-toast[hidden] { display: none; }

/* ---------- 到达卡片 ---------- */
.nav-arrive {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 78%;
    max-width: 300px;
    padding: 28px 22px 24px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(30, 20, 15, 0.28);
    text-align: center;
    animation: arrive-pop 0.3s ease;
}
@keyframes arrive-pop {
    from { opacity: 0; transform: translate(-50%, -46%) scale(0.92); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.nav-arrive[hidden] { display: none; }
.nav-arrive__emoji { font-size: 44px; line-height: 1; }
.nav-arrive__title {
    margin-top: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
}
.nav-arrive__name {
    margin-top: 4px;
    font-size: 0.95rem;
    color: var(--ink-soft);
}
.nav-arrive__btn {
    margin-top: 18px;
    width: 100%;
    min-height: 46px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--cherry), var(--cherry-deep));
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 2px;
    cursor: pointer;
}

/* ---------- 底部信息条 ---------- */
.nav-bottom {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(30, 20, 15, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.nav-bottom__remain {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex: 0 0 auto;
}
.nav-bottom__dist {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--cherry);
    line-height: 1.1;
}
.nav-bottom__time {
    font-size: 0.82rem;
    color: var(--ink-soft);
    white-space: nowrap;
}
.nav-bottom__road {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.82rem;
    color: var(--ink-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
    padding-right: 2px;
}
.nav-bottom__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-icon-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: var(--cherry-soft);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav-end-btn {
    min-height: 42px;
    padding: 0 18px;
    border: none;
    border-radius: 21px;
    background: var(--cherry);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
.nav-end-btn:active { background: var(--cherry-deep); }

/* ---------- 地图上的导航箭头（北朝上，箭头随 heading 旋转） ---------- */
.nav-arrow-icon {
    background: none;
    border: none;
}
.nav-arrow-marker {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.35s ease;
}
.nav-arrow-marker svg {
    width: 22px;
    height: 22px;
}
.nav-arrow-marker svg path { fill: var(--cherry); }
.leaflet-zoom-anim .nav-arrow-marker { transition: none; }

/* ---------- 移动端微调 ---------- */
@media (max-width: 767px) {
    .nav-card__main { font-size: 1.15rem; }
    .nav-card__icon { width: 52px; height: 52px; }
    .nav-bottom__dist { font-size: 1.2rem; }
    .nav-bottom__road { display: none; }  /* 窄屏路名让位给距离/操作 */
    .nav-arrive { width: 82%; }
    .route-comparison-row { padding-left: 43px; max-width: 96%; }
    .route-comparison-card { padding: 10px 11px 9px; }

    /* 导航中：地图占满整屏（高德同款沉浸态），退出导航恢复 */
    body.nav-running { grid-template-rows: 1fr; }
    body.nav-running .chat-panel { display: none; }
}


@media (pointer: coarse) {
    .kbd-hint-bar { display: none !important; }
}

@media (max-width: 359px) {
    .floating-header { padding-left: 10px; padding-right: 10px; }
    .header-left, .header-right { flex-shrink: 0; }
    .header-right { gap: 4px; }
    .app-title { white-space: nowrap; font-size: 0.88rem; }
    .weather-badge { padding-inline: 5px; }
    .weather-badge #weather-text { display: none; }
}

/* Desktop route results: give the route itself room, keep supporting detail on demand. */
body.is-planning-mode .explanation-box { display: none !important; }
body.is-planning-mode.has-route-results .desktop-mode-card { display: none !important; }

.desktop-mode-card {
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
}
.desktop-mode-card__icon { width: 30px; height: 30px; flex-basis: 30px; }
.desktop-mode-card__body p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 0.69rem;
    line-height: 1.4;
}
.desktop-mode-card__status { padding: 3px 6px; font-size: 0.6rem; }

.desktop-route-workbench {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.desktop-route-details,
.poi-section {
    overflow: hidden;
    border: 1px solid var(--divider);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.9);
}
.desktop-route-details__summary,
.poi-section__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 40px;
    padding: 8px 11px;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
}
.desktop-route-details__summary::-webkit-details-marker,
.poi-section__summary::-webkit-details-marker { display: none; }
.desktop-route-details__summary::after,
.poi-section__summary::after {
    flex: 0 0 auto;
    content: "⌄";
    color: var(--cherry-deep);
    font-size: 0.9rem;
    font-weight: 700;
    transition: transform 0.16s ease;
}
.desktop-route-details[open] > .desktop-route-details__summary::after,
.poi-section[open] > .poi-section__summary::after { transform: rotate(180deg); }
.desktop-route-details__summary:focus-visible,
.poi-section__summary:focus-visible {
    outline: 3px solid #276E8A;
    outline-offset: -3px;
}
.desktop-route-details__summary strong,
.poi-section__summary strong { font-size: 0.75rem; }
.desktop-route-details__summary span,
.poi-section__summary span {
    margin-left: auto;
    color: var(--ink-light);
    font-size: 0.67rem;
    white-space: nowrap;
}
.desktop-route-details .desktop-route-steps {
    max-height: 180px;
    padding: 2px 7px 7px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.desktop-route-actions { display: block; margin: 5px 9px 0; }
.desktop-route-action { width: 100%; }
.desktop-route-mobile-link { min-height: 36px; }
.desktop-route-workbench__hint {
    margin: 5px 10px 8px;
    font-size: 0.64rem;
}
.poi-section { margin-top: 0; }
.poi-tags {
    max-height: 150px;
    padding: 2px 9px 9px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.poi-tags li { max-width: 100%; overflow-wrap: anywhere; }

@container chat-panel (max-width: 420px) {
    .desktop-mode-card__icon { display: none; }
    .desktop-mode-card__body p { -webkit-line-clamp: 2; }
    .desktop-mode-card__status { font-size: 0.57rem; }
    .desktop-route-details__summary,
    .poi-section__summary { padding-inline: 9px; }
    .desktop-route-details__summary span,
    .poi-section__summary span { font-size: 0.63rem; }
    .poi-tags li { padding: 5px 8px; font-size: 0.72rem; }
}
