/* 全局重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Source Han Serif', 'SimSun', serif;
    background-color: #f5f0e6;
    color: #2c2c2c;
}

/* 顶部导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #8b2e2e;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.logo-title {
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.logo {
    width: 40px;
    height: 40px;
    background-color: #c9a961;
    border-radius: 50%;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.title {
    font-size: 1.4em;
    font-weight: bold;
    cursor: pointer;
}

.nav-links {
    display: flex;
    align-items: center;
    padding-right: 20px;
}

.nav-btn {
    background: none;
    border: none;
    color: white;
    margin-left: 15px;
    cursor: pointer;
    font-size: 1em;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.nav-btn.active {
    background-color: #c9a961;
    color: #2c2c2c;
}

/* 坐标模式指示器 */
.coord-mode-indicator {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #c9a961;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 1002;
    font-weight: bold;
    display: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.coord-mode-indicator.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 地图容器 */
#map {
    position: absolute;
    top: 60px;
    bottom: 60px;
    width: 100%;
    z-index: 100;
}

/* 底部信息栏 */
.footer-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #8b2e2e;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.footer-info {
    padding: 0 20px;
    font-size: 0.9em;
}

.legend {
    padding: 0 20px;
    font-size: 0.9em;
}

/* 加载动画 */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid #8b2e2e;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 信息窗口样式 */
.info-window {
    max-width: 300px;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.info-window * {
    border: none !important;
    box-shadow: none !important;
}

.info-title {
    font-weight: bold;
    color: #8b2e2e;
    margin-bottom: 5px;
}

.info-link {
    display: block;
    margin-top: 10px;
    color: #c9a961;
    text-decoration: none;
}

.info-link:hover {
    text-decoration: underline;
}

/* 搜索框容器 */
.search-container {
    position: absolute;
    top: 70px;
    right: 20px;
    z-index: 1001;
    background: white;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

        .search-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .search-input {
            padding: 8px;
            border: 1px solid #ccc;
            border-radius: 4px 0 0 4px;
            flex: 1;
        }

.search-btn {
    background-color: #8b2e2e;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.search-btn:hover {
    background-color: #a83a3a;
}

/* POI搜索框样式 */
.poi-search-row {
    display: flex;
    justify-content: space-between;
    border-top: 1px dashed #ddd;
    padding-top: 10px;
    align-items: center;
    gap: 8px;
}

.city-select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    font-size: 14px;
}

.city-select:focus {
    outline: none;
    border-color: #c9a961;
}

.poi-search-input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
    width: 140px;
    flex: 1;
}

.poi-search-btn {
    background-color: #c9a961;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.poi-search-btn:hover {
    background-color: #b09353;
}

/* POI搜索结果列表 */
.poi-results {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 10px;
    border-top: 1px dashed #ddd;
    padding-top: 10px;
}

.poi-result-item {
    padding: 8px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.poi-result-item:hover {
    background-color: #f5f0e6;
}

.poi-result-item:last-child {
    border-bottom: none;
}

.poi-result-name {
    font-weight: bold;
    color: #8b2e2e;
}

.poi-result-address {
    font-size: 0.85em;
    color: #666;
    margin-top: 3px;
}

/* 物件列表侧边栏 */
.sidebar {
    position: absolute;
    top: 60px;
    left: 20px;
    width: 250px;
    height: calc(100vh - 120px);
    background: white;
    z-index: 1001;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    padding: 10px;
}

.sidebar-title {
    color: #8b2e2e;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.relic-list {
    list-style: none;
    padding: 0;
}

.relic-list li {
    padding: 8px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.relic-list li:hover {
    background-color: #f5f0e6;
}

.relic-list li.active {
    background-color: #c9a961;
    color: white;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    min-width: 300px;
    z-index: 10000;
    overflow: hidden;
}

.modal-header {
    padding: 15px 20px;
    background-color: #8b2e2e;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-weight: bold;
    font-size: 1.1em;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
}

.modal-body {
    padding: 20px;
    line-height: 1.6;
}

.modal-footer {
    padding: 15px 20px;
    background-color: #f5f0e6;
    text-align: right;
}

.modal-btn {
    background-color: #c9a961;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.modal-btn:hover {
    background-color: #b09353;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        height: 50px;
    }

    .title {
        font-size: 1.1em;
    }

    .nav-btn {
        padding: 6px 10px;
        font-size: 0.9em;
    }

    #map {
        top: 50px;
        bottom: 50px;
    }

    .footer-bar {
        height: 50px;
    }

    .footer-info, .legend {
        font-size: 0.8em;
    }

    .search-container {
        top: 60px;
        right: 10px;
        width: calc(100% - 20px);
    }

    .search-input {
        width: calc(100% - 70px);
    }

    .sidebar {
        width: 100%;
        top: 120px;
        left: 0;
        height: 300px;
    }
}