* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
    width: 100%;
    margin-top: 64px;
}

/* ========== 顶部导航栏样式 - Logo居左，菜单靠右 ========== */
.top-header {
    background: linear-gradient(135deg, #1a6dcc 0%, #0d4d9c 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    width: 100%;
    height: 64px;
}

.navbar {
    width: 100%;
    height: 100%;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo区域 - 完全居左 */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.nav-brand img {
    height: 42px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 1px;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 11px;
    opacity: 0.85;
    letter-spacing: 0.5px;
}

/* 导航菜单 - 靠右 */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 8px;
    margin: 0;
    padding: 0;
    height: 100%;
    align-items: center;
}

.nav-item {
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-decoration: none;
    color: white;
    font-weight: 500;
    padding: 0 18px;
    transition: all 0.3s ease;
    border-radius: 6px;
    font-size: 15px;
    white-space: nowrap;
    gap: 8px;
}

.nav-link i {
    font-size: 18px;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.25);
    font-weight: 600;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .navbar {
        padding: 0 16px;
    }
    
    .brand-title {
        font-size: 18px;
    }
    
    .brand-subtitle {
        font-size: 9px;
    }
    
    .nav-brand img {
        height: 34px;
    }
    
    .nav-link {
        padding: 0 12px;
        font-size: 13px;
    }
    
    .nav-link span {
        display: none;
    }
    
    .nav-link i {
        font-size: 20px;
        margin: 0;
    }
    
    .container {
        margin-top: 56px;
    }
    
    .top-header {
        height: 56px;
    }
}

@media screen and (max-width: 480px) {
    .brand-title {
        font-size: 14px;
    }
    
    .brand-subtitle {
        display: none;
    }
    
    .nav-brand img {
        height: 28px;
    }
    
    .nav-link {
        padding: 0 10px;
    }
}

/* ========== 侧边栏样式 ========== */
.sidebar {
    width: 380px;
    background-color: #fff;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: width 0.3s ease;
    flex-shrink: 0;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.sidebar.hidden {
    width: 0 !important;
    padding: 0;
    margin: 0;
    overflow: hidden;
    border-right: none;
}

/* 侧边栏头部样式 */
.sidebar-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #1a6dcc 0%, #0d4d9c 100%);
    color: white;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-header h1 {
    font-size: 22px;
    margin: 0;
}

.sidebar-header p {
    font-size: 12px;
    opacity: 0.9;
    margin: 5px 0 0 0;
}

.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.header-logo img {
    height: 50px;
    width: auto;
}

/* 主界面容器 */
.main-interface {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* 用户信息栏 - 靠右显示 */
.user-info {
    padding: 25px 25px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
}

.user-info span {
    font-weight: bold;
    color: #1a6dcc;
    font-size: 15px;
}

.logout-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 15px;
}

.logout-btn:hover {
    background-color: #c0392b;
}

/* 内容区域 */
.content {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    min-height: 0;
}

/* AI助手样式 */
.ai-assistant-box {
    margin-bottom: 15px;
    border: 1px solid #1a6dcc;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.ai-header {
    background: linear-gradient(135deg, #1a6dcc 0%, #0d4d9c 100%);
    color: white;
    padding: 8px 12px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.ai-status {
    font-size: 12px;
    opacity: 0.8;
}

.ai-chat-history {
    max-height: 100px;
    overflow-y: auto;
    padding: 8px 12px;
    font-size: 12px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
}

.ai-chat-history .user-msg {
    text-align: right;
    margin: 6px 0;
    color: #1a6dcc;
}

.ai-chat-history .ai-reply-msg {
    margin: 6px 0;
    color: #666;
}

.ai-chat-history .ai-thinking {
    color: #999;
    font-style: italic;
}

.ai-chat-history .welcome-msg {
    color: #666;
}

.ai-input-area {
    display: flex;
    padding: 8px;
    background: #fff;
    flex-shrink: 0;
}

.ai-input {
    flex: 1;
    border: 1px solid #ddd;
    padding: 6px 10px;
    border-radius: 4px;
    outline: none;
    font-size: 12px;
}

.ai-input:focus {
    border-color: #1a6dcc;
}

.ai-send-btn {
    margin-left: 8px;
    background: #1a6dcc;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.ai-send-btn:hover {
    background: #0d4d9c;
}

/* 搜索框样式 */
.search-box {
    margin-bottom: 15px;
    position: relative;
    flex-shrink: 0;
}

.search-box input {
    width: 100%;
    padding: 8px 12px;
    padding-right: 35px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: #1a6dcc;
}

.search-box button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #1a6dcc;
    font-size: 16px;
    cursor: pointer;
}

.search-results {
    position: absolute;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 1000;
    display: none;
    top: 100%;
    margin-top: 4px;
}

.search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background-color: #f5f9ff;
    padding-left: 18px;
}

.search-result-item h4 {
    font-size: 14px;
    margin-bottom: 5px;
    color: #1a6dcc;
}

.search-result-item p {
    font-size: 12px;
    color: #666;
}

.no-results {
    padding: 24px 15px;
    text-align: center;
    color: #666;
    border-bottom: 1px solid #f0f0f0;
}

.web-search-recommend {
    padding: 15px;
    background: linear-gradient(135deg, #f0f8ff 0%, #e8f4f8 100%);
    border-radius: 0 0 8px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.web-search-recommend:hover {
    background: linear-gradient(135deg, #e8f4f8 0%, #d8eaf7 100%);
}

.web-search-recommend .recommend-title {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #1a6dcc;
    font-weight: 500;
}

.web-search-recommend .recommend-title span {
    display: inline-block;
    width: 22px;
    height: 22px;
    background-color: #1a6dcc;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 22px;
    font-size: 12px;
    margin-right: 8px;
}

/* 筛选器样式 */
.filters {
    margin-bottom: 15px;
    flex-shrink: 0;
}

.filter-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    max-height: none;
    overflow-y: visible;
}

.filter-btn {
    padding: 5px 12px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}

.filter-btn.active {
    background-color: #1a6dcc;
    color: white;
    border-color: #1a6dcc;
}

.filter-btn:hover {
    background-color: #e0e0e0;
}

.filter-btn.active:hover {
    background-color: #0d4d9c;
}

.slider-container {
    padding: 0 5px;
}

input[type="range"] {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    background: #ddd;
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1a6dcc;
    cursor: pointer;
    border: none;
}

.slider-value {
    text-align: center;
    margin-top: 6px;
    font-weight: bold;
    color: #1a6dcc;
    font-size: 12px;
}

/* 景区列表样式 */
.scenic-list {
    flex: 1;
    overflow-y: auto;
    min-height: 150px;
}

.list-title {
    font-weight: bold;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid #1a6dcc;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 5;
    padding-top: 5px;
}

.scenic-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.scenic-item:hover {
    background-color: #f9f9f9;
}

.scenic-item h4 {
    font-size: 13px;
    margin-bottom: 5px;
    color: #1a6dcc;
}

/* 景区类型标签样式 - 背景只覆盖文字本身 */
.scenic-type {
    display: inline-block;   /* 必须是 inline-block，不能是 block */
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    margin-right: 6px;
    margin-bottom: 4px;
    width: auto;             /* 宽度由内容决定 */
    max-width: fit-content;  /* 宽度适应内容 */
    background-size: auto;   /* 背景不拉伸 */
}

/* ========== 新版标签样式 - 背景只覆盖文字 ========== */

/* 景区列表项 */
.scenic-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.scenic-item:hover {
    background-color: #f9f9f9;
}

/* 标题行：名称和标签在一行 */
.scenic-item-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

/* 景区名称 */
.scenic-name {
    font-size: 14px;
    font-weight: bold;
    color: #1a6dcc;
}

/* 景区类型标签样式 - 颜色方案 */
.scenic-type {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    margin-right: 6px;
    margin-bottom: 4px;
}

/* 5A级景区 - 红色 */
.type-5a {
    background-color: #ff6b6b;
    color: white;
}

/* 4A级景区 - 青色 */
.type-4a {
    background-color: #4ecdc4;
    color: white;
}

/* 人文古迹（古建筑、古遗址、博物馆等）- 金色/黄色 */
.type-ancient {
    background-color: #ffd166;
    color: #333;
}

/* 网红打卡点/网红旅游景区 - 紫色 */
.type-hotspot {
    background-color: #c06cff;
    color: white;
}

/* 网红餐厅 - 橙色 */
.type-food {
    background-color: #ff9f4a;
    color: white;
}


/* 地址 */
.scenic-address {
    font-size: 11px;
    color: #666;
    margin-bottom: 5px;
}

/* 描述 */
.scenic-description {
    font-size: 11px;
    color: #888;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 推荐度 */
.scenic-recommend {
    margin-top: 6px;
    font-size: 11px;
    color: #ff9800;
}

/* 地图容器样式 - 修复底部超出问题 */
.map-container {
    flex: 1 1 auto;
    position: relative;
    height: 100%;
    width: 100%;
    transition: all 0.3s ease;
    min-width: 0;
    /* 移除 padding-bottom，避免影响地图高度 */
    box-sizing: border-box;
}

#map {
    height: 100%;
    width: 100%;
    min-width: 0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* 或者使用 fixed 定位方式 */
.map-wrapper {
    position: relative;
    height: 100%;
    width: 100%;
}

/* 侧边栏切换按钮 - 下移 */
.sidebar-toggle-btn {
    position: fixed;
    top: 80px;
    left: 20px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    background-color: white;
    border: none;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: #333;
    transition: all 0.2s;
}

.sidebar-toggle-btn:hover {
    background-color: #f5f5f5;
    transform: translateY(-2px);
}

/* 地图控件 */
.map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-btn {
    width: 40px;
    height: 40px;
    background-color: white;
    border: none;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: #333;
    transition: all 0.2s;
}

.control-btn:hover {
    background-color: #f5f5f5;
    transform: translateY(-2px);
}

/* 底部备案信息 */
.footer {
    width: 100%;
    background: rgba(245, 245, 245, 0.88);
    backdrop-filter: blur(4px);
    text-align: right;
    padding: 6px 12px;
    font-size: 10px;
    color: #666;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 998;
    box-sizing: border-box;
    border-top: 1px solid rgba(224, 224, 224, 0.6);
}

    .footer span {
        display: inline-block;
        white-space: nowrap;
    }

    .footer a {
        color: #666;
        text-decoration: none;
        margin: 0 4px;
    }

        .footer a:hover {
            color: #1a6dcc;
            text-decoration: underline;
        }


/* 弹窗图片样式 - 4:3比例 */
.popup-image {
    margin: 10px 0;
    text-align: center;
}

.popup-image img {
    width: 100%;
    max-width: 280px;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.popup-image img:hover {
    transform: scale(1.02);
}

/* 信息窗口样式 */
.custom-popup {
    max-width: 280px;
    min-width: 240px;
}

.popup-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #1a6dcc;
}

/* 弹窗类型标签底色 */
.popup-type.type-5a { 
    background: #ff6b6b; 
    color: white; 
}

.popup-type.type-4a { 
    background: #4ecdc4; 
    color: white; 
}

.popup-type.type-ancient { 
    background: #ffd166; 
    color: #333; 
}

.popup-type.type-hotspot { 
    background: #c06cff; 
    color: white; 
}

.popup-type.type-food { 
    background: #ff9f4a; 
    color: white; 
}

.popup-address, .popup-year, .popup-description {
    margin-bottom: 6px;
    font-size: 12px;
}

.popup-year {
    font-weight: bold;
    color: #d35400;
}

.popup-description {
    line-height: 1.4;
    color: #666;
}

/* ========== 地图标记样式 - 带图片边框颜色 ========== */
.scenic-marker-with-img {
    background: transparent;
    min-width: 80px;
    max-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

/* 地图标记图片样式 - 基础样式 */
.scenic-marker-with-img .marker-img {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    background: #f5f5f5;
    transition: transform 0.2s, border-color 0.2s;
}

.scenic-marker-with-img .marker-img:hover {
    transform: scale(1.05);
}

/* 5A级景区图片边框 - 红色 */
.scenic-marker-with-img.type-5a .marker-img {
    border-color: #ff6b6b;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

/* 4A级景区图片边框 - 青色 */
.scenic-marker-with-img.type-4a .marker-img {
    border-color: #4ecdc4;
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.3);
}

/* 人文古迹/博物馆图片边框 - 金色 */
.scenic-marker-with-img.type-ancient .marker-img {
    border-color: #ffd166;
    box-shadow: 0 2px 8px rgba(255, 209, 102, 0.3);
}

/* 网红打卡点/网红旅游景区图片边框 - 紫色 */
.scenic-marker-with-img.type-hotspot .marker-img {
    border-color: #c06cff;
    box-shadow: 0 2px 8px rgba(192, 108, 255, 0.3);
}

/* 网红餐厅图片边框 - 橙色 */
.scenic-marker-with-img.type-food .marker-img {
    border-color: #ff9f4a;
    box-shadow: 0 2px 8px rgba(255, 159, 74, 0.3);
}

.scenic-marker-with-img .marker-text {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    background: rgba(0,0,0,0.6);
    padding: 2px 6px;
    border-radius: 12px;
    max-width: 90px;
    white-space: normal;
    word-wrap: break-word;
}

/* 无图片的文字标记样式 */
.scenic-marker {
    min-width: 60px;
    max-width: 100px;
    padding: 4px 8px;
    border-radius: 20px;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scenic-marker.type-5a { background: #ff6b6b; }
.scenic-marker.type-4a { background: #4ecdc4; }
.scenic-marker.type-ancient { background: #ffd166; }
.scenic-marker.type-hotspot { background: #c06cff; }
.scenic-marker.type-food { background: #ff9f4a; }

.scenic-marker.type-5a { background: #ff6b6b; }
.scenic-marker.type-4a { background: #4ecdc4; }
.scenic-marker.type-ancient { background: #ffd166; }
.scenic-marker.type-hotspot { background: #c06cff; }
.scenic-marker.type-food { background: #ff9f4a; }

.scenic-marker .marker-text {
    font-size: 10px;
    font-weight: bold;
    color: white;
    text-align: center;
}

/* 弹窗类型标签底色 */
.popup-type.type-5a { background: #ff6b6b; color: white; }
.popup-type.type-4a { background: #4ecdc4; color: white; }
.popup-type.type-ancient { background: #ffd166; color: #333; }
.popup-type.type-hotspot { background: #c06cff; color: white; }
.popup-type.type-food { background: #ff9f4a; color: white; }

/* 隐藏Leaflet版权 */
.leaflet-control-attribution {
    display: none !important;
}

/* 滚动条美化 */
.content::-webkit-scrollbar,
.ai-chat-history::-webkit-scrollbar,
.scenic-list::-webkit-scrollbar,
.search-results::-webkit-scrollbar {
    width: 6px;
}

.content::-webkit-scrollbar-track,
.ai-chat-history::-webkit-scrollbar-track,
.scenic-list::-webkit-scrollbar-track,
.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.content::-webkit-scrollbar-thumb,
.ai-chat-history::-webkit-scrollbar-thumb,
.scenic-list::-webkit-scrollbar-thumb,
.search-results::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.content::-webkit-scrollbar-thumb:hover,
.ai-chat-history::-webkit-scrollbar-thumb:hover,
.scenic-list::-webkit-scrollbar-thumb:hover,
.search-results::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 45%;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
    
    .sidebar.hidden {
        height: 0 !important;
        border-bottom: none;
    }
    
    .map-container {
        height: 55%;
        width: 100%;
    }
    
    .sidebar-toggle-btn {
        left: 10px;
        top: 70px;
    }
}

@media (max-width: 576px) {
    .sidebar {
        height: 50%;
    }
    
    .map-container {
        height: 50%;
    }
    
    .content {
        padding: 12px;
    }
    
    .sidebar-header h1 {
        font-size: 18px;
    }
    
    .sidebar-header p {
        font-size: 10px;
    }
    
    .filter-options {
        justify-content: center;
    }
    
    .footer {
        padding: 5px 15px 5px 0;
        font-size: 9px;
    }
    
    .footer a {
        display: inline-block;
        margin: 0 2px;
    }
    
    .sidebar-toggle-btn {
        top: 66px;
    }
    
    .scenic-marker-with-img .marker-img {
        width: 55px;
        height: 55px;
    }
    
    .scenic-marker-with-img .marker-text {
        font-size: 10px;
    }
}