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

: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,
        #E67E22 0,
        #E67E22 7px,
        transparent 7px,
        transparent 12px
    );
}

.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); }

/* ==============================
   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;
}

/* ===== 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);
}

/* ===== 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;
    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: #E8929C; }
.travel-mode-btn.active[data-travel-mode="bike"]  { background: #7BA37B; }
.travel-mode-btn.active[data-travel-mode="drive"] { background: #6A9FB5; }

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

/* ===== 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;
}

.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; }

@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;
}

/* 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 ... */ }

/* ==============================
   RESPONSIVE: Mobile (<768px)
   ============================== */
@media (max-width: 767px) {
    body {
        grid-template-columns: 1fr;
        grid-template-rows: 55vh 1fr;
    }

    .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);
    }

    .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; }

    .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; }

    /* 移动端没人用键盘快捷键，隐藏 */
    .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;
}
.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-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;
    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;
}
.install-banner__sub { font-size: 0.74rem; color: #A87880; margin-top: 1px; }
.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 {
    background: none;
    border: 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;
}
.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-dist {
    font-size: 11px;
    color: var(--ink-light);
}

.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;
}

/* ===== 站点页脚：ICP 备案号（静态硬写，供腾讯安全爬虫识别） ===== */
.site-footer {
    position: fixed;
    left: 0; right: 0;
    bottom: calc(0px + env(safe-area-inset-bottom, 0px));
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 16px;
    font-size: 11px;
    line-height: 1;
    color: rgba(107, 40, 40, 0.55);
    pointer-events: none;  /* 默认不抢点击，链接单独开启 */
    text-shadow: 0 1px 3px rgba(255,255,255,0.8);
}
.site-footer a {
    color: rgba(107, 40, 40, 0.55);
    text-decoration: none;
    border-bottom: none;
    pointer-events: auto;
    transition: color 0.15s ease;
}
.site-footer a:hover,
.site-footer a:focus {
    color: rgba(107, 40, 40, 0.85);
    text-decoration: underline;
}
.footer-dot { opacity: 0.4; }
.footer-copy { white-space: nowrap; }

/* 桌面端页脚位置略高，避开 Leaflet 缩放控件 */
@media (min-width: 768px) {
    .site-footer {
        bottom: 18px;
    }
}
