﻿        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html, body {
            width: 100%;
            height: 100%;
            overflow: hidden;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            background: #f5f5f5;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        #map {
            width: 100%;
            height: 100vh;
            position: absolute;
            top: 0;
            left: 0;
            z-index: 1;
        }

        /* 开始导览按钮（iOS 语音激活） */
        #start-guide-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.8);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 5000;
            transition: opacity 0.3s ease;
        }

        #start-guide-overlay.hidden {
            opacity: 0;
            pointer-events: none;
        }

        .start-guide-content {
            text-align: center;
            padding: 40px;
            background: white;
            border-radius: 24px;
            max-width: 320px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        }

        .start-guide-content h2 {
            font-size: 24px;
            color: #333;
            margin-bottom: 16px;
        }

        .start-guide-content p {
            font-size: 14px;
            color: #666;
            line-height: 1.6;
            margin-bottom: 24px;
        }

        #start-guide-btn {
            width: 100%;
            padding: 16px 32px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: transform 0.2s ease;
        }

        #start-guide-btn:active {
            transform: scale(0.98);
        }

        /* 自定义 Leaflet 弹窗样式 */
        .leaflet-popup-content-wrapper {
            border-radius: 16px;
            padding: 0;
            overflow: hidden;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
        }

        .leaflet-popup-content {
            margin: 0;
            width: 280px !important;
        }

        .popup-content {
            padding: 16px;
        }

        .popup-content h3 {
            font-size: 18px;
            font-weight: 600;
            color: #333;
            margin-bottom: 8px;
        }

        .popup-content .type-badge {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 500;
            margin-bottom: 12px;
        }

        .popup-content .type-badge.attraction {
            background: #e3f2fd;
            color: #1976d2;
        }

        .popup-content .type-badge.service {
            background: #f3e5f5;
            color: #7b1fa2;
        }

        .popup-content .type-badge.toilet {
            background: #e8f5e9;
            color: #388e3c;
        }

        .popup-content .type-badge.parking {
            background: #fff3e0;
            color: #f57c00;
        }

        .popup-content .type-badge.food {
            background: #fce4ec;
            color: #c2185b;
        }

        .popup-content p {
            font-size: 14px;
            line-height: 1.6;
            color: #666;
            margin-bottom: 12px;
        }

        .popup-content img {
            width: 100%;
            height: 160px;
            object-fit: cover;
            border-radius: 8px;
            margin-top: 8px;
        }

        .poi-marker {
            background: transparent;
            border: 0;
        }

        .poi-pin {
            position: relative;
            width: 30px;
            height: 30px;
            border: 2px solid #fff;
            border-radius: 50% 50% 50% 0;
            background: #c43d2b;
            transform: rotate(-45deg);
            box-shadow: 0 3px 9px rgba(0, 0, 0, 0.28);
        }

        .poi-pin::after {
            content: '';
            position: absolute;
            left: 8px;
            top: 8px;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: #fff;
        }

        .poi-pin.service {
            background: #2f72c9;
        }

        .poi-pin.toilet {
            background: #2f8f56;
        }

        .poi-pin.parking {
            background: #d68522;
        }

        .poi-pin.food {
            background: #c2185b;
        }

        .poi-category-tabs {
            position: fixed;
            top: calc(env(safe-area-inset-top, 0px) + 14px);
            left: 12px;
            right: 12px;
            z-index: 1000;
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 8px;
            padding: 8px;
            border: 1px solid rgba(48, 36, 28, 0.08);
            border-radius: 10px;
            background: rgba(255, 255, 255, 0.94);
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
        }

        .poi-category-tab {
            min-height: 42px;
            padding: 8px 6px;
            border: 1px solid rgba(80, 52, 36, 0.14);
            border-radius: 8px;
            background: #fff;
            color: #2f2f2f;
            font-size: 15px;
            font-weight: 700;
            line-height: 1.2;
            cursor: pointer;
            transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
        }

        .poi-category-tab.active {
            border-color: #bd4b2a;
            background: #bd4b2a;
            color: #fff;
        }

        /* 手绘图主要景点标注 */
        .handdrawn-marker {
            background: transparent;
            border: 0;
        }

        .handdrawn-marker-inner {
            display: flex;
            align-items: center;
            gap: 6px;
            min-width: 128px;
            filter: drop-shadow(0 3px 8px rgba(80, 32, 16, 0.28));
        }

        .handdrawn-pin {
            position: relative;
            width: 24px;
            height: 24px;
            flex: 0 0 24px;
            background: #d72f22;
            border: 2px solid #fff;
            border-radius: 50% 50% 50% 0;
            transform: rotate(-45deg);
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
        }

        .handdrawn-pin::after {
            content: '';
            position: absolute;
            left: 6px;
            top: 6px;
            width: 8px;
            height: 8px;
            background: #fff;
            border-radius: 50%;
        }

        .handdrawn-label {
            display: inline-flex;
            align-items: center;
            min-height: 26px;
            max-width: 104px;
            padding: 4px 8px;
            border: 1px solid rgba(159, 52, 30, 0.2);
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.95);
            color: #5f2619;
            font-size: 13px;
            font-weight: 700;
            line-height: 1.15;
            white-space: normal;
        }

        .map-error {
            position: fixed;
            left: 16px;
            right: 16px;
            top: 50%;
            z-index: 2600;
            transform: translateY(-50%);
            padding: 18px 16px;
            border-radius: 10px;
            background: rgba(255, 255, 255, 0.96);
            color: #4a2a1c;
            font-size: 15px;
            line-height: 1.6;
            text-align: center;
            box-shadow: 0 10px 32px rgba(70, 45, 30, 0.2);
        }

        /* 用户位置标记 */
        .user-location-marker {
            width: 20px;
            height: 20px;
            background: #4285f4;
            border: 3px solid white;
            border-radius: 50%;
            box-shadow: 0 2px 8px rgba(66, 133, 244, 0.4);
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0% {
                box-shadow: 0 0 0 0 rgba(66, 133, 244, 0.7);
            }
            70% {
                box-shadow: 0 0 0 15px rgba(66, 133, 244, 0);
            }
            100% {
                box-shadow: 0 0 0 0 rgba(66, 133, 244, 0);
            }
        }

        /* 重新定位按钮 */
        .relocate-btn {
            position: fixed;
            bottom: 120px;
            right: 20px;
            width: 48px;
            height: 48px;
            background: white;
            border: none;
            border-radius: 50%;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #4285f4;
            transition: all 0.3s ease;
            z-index: 1000;
        }

        .relocate-btn:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
        }

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

        .map-mode-control {
            position: fixed;
            top: calc(env(safe-area-inset-top, 0px) + 86px);
            right: 16px;
            z-index: 1000;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            width: 72px;
            padding: 10px 8px;
            border: 1px solid rgba(80, 52, 36, 0.12);
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.94);
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
            color: #4a3328;
            font-size: 13px;
            font-weight: 600;
        }

        .map-mode-control input {
            position: absolute;
            width: 1px;
            height: 1px;
            opacity: 0;
            pointer-events: none;
        }

        .map-mode-switch {
            position: relative;
            width: 42px;
            height: 24px;
            border-radius: 999px;
            background: #d7d7d7;
            transition: background 0.2s ease;
        }

        .map-mode-switch::after {
            content: '';
            position: absolute;
            top: 3px;
            left: 3px;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: #fff;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.24);
            transition: transform 0.2s ease;
        }

        .map-mode-control input:checked + .map-mode-switch {
            background: #bd4b2a;
        }

        .map-mode-control input:checked + .map-mode-switch::after {
            transform: translateX(18px);
        }

        .custom-zoom-control {
            position: fixed;
            top: calc(env(safe-area-inset-top, 0px) + 186px);
            right: 16px;
            z-index: 1000;
            display: flex;
            flex-direction: column;
            width: 72px;
            overflow: hidden;
            border: 1px solid rgba(80, 52, 36, 0.12);
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.94);
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
        }

        .custom-zoom-control button {
            width: 100%;
            height: 42px;
            border: 0;
            background: #fff;
            color: #3b2d26;
            font-size: 24px;
            font-weight: 700;
            line-height: 1;
            cursor: pointer;
        }

        .custom-zoom-control button + button {
            border-top: 1px solid rgba(80, 52, 36, 0.12);
        }

        .custom-zoom-control button:active {
            background: #f5eee8;
        }

        .ai-guide-avatar {
            position: fixed;
            left: 16px;
            bottom: 94px;
            z-index: 1200;
            width: min(92vw, 420px);
            min-height: 180px;
            pointer-events: none;
        }

        .ai-guide-avatar img {
            position: absolute;
            left: 0;
            bottom: 0;
            z-index: 2;
            width: 132px;
            height: 132px;
            object-fit: contain;
            filter: drop-shadow(0 12px 22px rgba(55, 35, 28, 0.22));
            animation: aiCharacterFloat 3s ease-in-out infinite;
        }

        .ai-guide-bubble {
            position: absolute;
            left: 104px;
            right: 0;
            bottom: 80px;
            min-height: 86px;
            max-height: 180px;
            padding: 14px 16px;
            border: 1px solid rgba(255, 122, 70, 0.22);
            border-radius: 18px 18px 18px 6px;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(255, 246, 239, 0.95));
            box-shadow: 0 12px 34px rgba(72, 43, 27, 0.18);
            transform-origin: left bottom;
            animation: bubbleIn 0.24s ease-out;
            overflow-y: auto;
        }

        .ai-guide-bubble::before {
            content: '';
            position: absolute;
            left: -10px;
            bottom: 18px;
            width: 18px;
            height: 18px;
            background: rgba(255, 255, 255, 0.97);
            border-left: 1px solid rgba(255, 122, 70, 0.18);
            border-bottom: 1px solid rgba(255, 122, 70, 0.18);
            transform: rotate(45deg);
        }

        .ai-guide-bubble.hidden {
            display: none;
        }

        .ai-guide-status {
            position: relative;
            z-index: 1;
            color: #3e332f;
            font-size: 15px;
            line-height: 1.65;
            white-space: pre-wrap;
        }

        .ai-guide-avatar.thinking img,
        .ai-guide-avatar.speaking img,
        .ai-guide-avatar.listening img {
            animation: aiTalk 0.85s ease-in-out infinite;
        }

        .ai-guide-avatar.thinking .ai-guide-bubble,
        .ai-guide-avatar.speaking .ai-guide-bubble,
        .ai-guide-avatar.listening .ai-guide-bubble {
            border-color: rgba(255, 122, 70, 0.35);
        }

        .voice-chat-bar {
            position: fixed;
            left: 16px;
            right: 16px;
            bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
            z-index: 1500;
            padding: 6px;
            border-radius: 18px;
            background: linear-gradient(135deg, rgba(255, 131, 76, 0.72), rgba(86, 162, 255, 0.66));
            box-shadow: 0 12px 30px rgba(34, 45, 62, 0.18);
        }

        .voice-hold-btn {
            width: 100%;
            height: 58px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 14px;
            border: 2px solid #111;
            border-radius: 14px;
            background: rgba(255, 255, 255, 0.97);
            color: #333;
            font-size: 18px;
            font-weight: 700;
            cursor: pointer;
            user-select: none;
            -webkit-user-select: none;
            touch-action: none;
        }

        .voice-hold-btn.recording {
            color: #bd4b2a;
            border-color: #bd4b2a;
            background: #fff8f4;
        }

        .voice-stop-icon {
            width: 26px;
            height: 26px;
            border: 3px solid #ff6b2d;
            border-radius: 50%;
            position: relative;
        }

        .voice-stop-icon::after {
            content: '';
            position: absolute;
            left: 6px;
            top: 6px;
            width: 8px;
            height: 8px;
            border-radius: 3px;
            background: #ff6b2d;
        }

        .voice-hold-btn.recording .voice-stop-icon {
            animation: recordingPulse 1s ease-in-out infinite;
        }

        @keyframes recordingPulse {
            0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 107, 45, 0.32); }
            50% { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(255, 107, 45, 0); }
        }

        @keyframes aiCharacterFloat {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-8px); }
        }

        @keyframes aiTalk {
            0%, 100% { transform: translateY(0) rotate(0deg); }
            35% { transform: translateY(-6px) rotate(-2deg); }
            70% { transform: translateY(-2px) rotate(2deg); }
        }

        @keyframes bubbleIn {
            from { opacity: 0; transform: translateY(10px) scale(0.96); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }

        /* AI 讲解窗口 */
        .explanation-panel {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: white;
            border-radius: 24px 24px 0 0;
            box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
            max-height: 70vh;
            display: flex;
            flex-direction: column;
            transition: transform 0.3s ease;
            z-index: 2000;
        }

        .explanation-panel.hidden {
            transform: translateY(100%);
        }

        .panel-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 24px;
            border-bottom: 1px solid #eee;
        }

        .panel-header h3 {
            font-size: 18px;
            font-weight: 600;
            color: #333;
        }

        .close-btn {
            width: 32px;
            height: 32px;
            border: none;
            background: #f5f5f5;
            border-radius: 50%;
            font-size: 24px;
            color: #666;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }

        .close-btn:hover {
            background: #e0e0e0;
        }

        .panel-content {
            flex: 1;
            overflow-y: auto;
            padding: 24px;
            -webkit-overflow-scrolling: touch;
        }

        .loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 40px 20px;
        }

        .loading.hidden {
            display: none;
        }

        .spinner {
            width: 40px;
            height: 40px;
            border: 4px solid #f3f3f3;
            border-top: 4px solid #4285f4;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 16px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .loading p {
            color: #666;
            font-size: 14px;
        }

        .explanation-text {
            font-size: 15px;
            line-height: 1.8;
            color: #333;
            white-space: pre-wrap;
        }

        .explanation-text.hidden {
            display: none;
        }

        .panel-actions {
            display: flex;
            gap: 12px;
            padding: 16px 24px;
            border-top: 1px solid #eee;
        }

        .action-btn {
            flex: 1;
            padding: 12px 20px;
            border: none;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: all 0.2s ease;
        }

        .action-btn:not(.secondary) {
            background: #4285f4;
            color: white;
        }

        .action-btn:not(.secondary):hover {
            background: #3367d6;
        }

        .action-btn.secondary {
            background: #f5f5f5;
            color: #666;
        }

        .action-btn.secondary:hover {
            background: #e0e0e0;
        }

        .action-btn:active {
            transform: scale(0.98);
        }

        /* 加载遮罩 */
        .loading-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(255, 255, 255, 0.95);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 3000;
            transition: opacity 0.3s ease;
        }

        .loading-overlay.hidden {
            opacity: 0;
            pointer-events: none;
        }

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

        .loading-content p {
            margin-top: 16px;
            font-size: 16px;
            color: #666;
        }

        .status-toast {
            position: fixed;
            left: 16px;
            right: 16px;
            top: calc(env(safe-area-inset-top, 0px) + 16px);
            z-index: 3000;
            padding: 12px 14px;
            border-radius: 12px;
            background: rgba(34, 34, 34, 0.92);
            color: #fff;
            font-size: 14px;
            line-height: 1.5;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
            transform: translateY(-16px);
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s ease, transform 0.2s ease;
        }

        .status-toast.visible {
            opacity: 1;
            transform: translateY(0);
        }

        .status-toast.warning {
            background: rgba(181, 101, 29, 0.95);
        }

        .calibration-panel {
            position: fixed;
            left: 16px;
            top: calc(env(safe-area-inset-top, 0px) + 72px);
            z-index: 2200;
            width: min(360px, calc(100vw - 32px));
            padding: 12px;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.96);
            box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
            color: #1f2933;
            font-size: 13px;
        }

        .calibration-header {
            font-size: 15px;
            font-weight: 700;
            margin-bottom: 10px;
        }

        .calibration-field {
            display: grid;
            gap: 6px;
            margin-bottom: 8px;
        }

        .calibration-field span,
        .calibration-mode {
            color: #52606d;
            font-size: 12px;
        }

        .calibration-field select,
        .calibration-panel textarea {
            width: 100%;
            border: 1px solid #d9e2ec;
            border-radius: 6px;
            background: #fff;
            color: #102a43;
            font: inherit;
        }

        .calibration-field select {
            height: 34px;
            padding: 0 8px;
        }

        .calibration-panel textarea {
            min-height: 112px;
            margin-top: 8px;
            padding: 8px;
            resize: vertical;
            font-family: Consolas, Monaco, monospace;
            font-size: 12px;
            line-height: 1.45;
        }

        .calibration-panel button {
            width: 100%;
            min-height: 36px;
            margin-top: 8px;
            border: 0;
            border-radius: 6px;
            background: #1f6feb;
            color: #fff;
            font-weight: 700;
        }

        /* 响应式调整 */
        @media (max-width: 480px) {
            .ai-guide-avatar {
                left: 10px;
                bottom: 100px;
                width: calc(100vw - 20px);
                min-height: 168px;
            }

            .ai-guide-avatar img {
                width: 116px;
                height: 116px;
            }

            .ai-guide-bubble {
                left: 92px;
                bottom: 72px;
                max-height: 150px;
                padding: 12px 14px;
            }

            .ai-guide-status {
                font-size: 14px;
                line-height: 1.55;
            }

            .poi-category-tabs {
                gap: 6px;
                padding: 6px;
            }

            .poi-category-tab {
                min-height: 40px;
                padding: 6px 4px;
                font-size: 13px;
            }

            .leaflet-popup-content {
                width: 260px !important;
            }

            .explanation-panel {
                max-height: 80vh;
            }

            .calibration-panel {
                left: 10px;
                right: 10px;
                top: calc(env(safe-area-inset-top, 0px) + 64px);
                width: auto;
            }
        }

