/* Map Page Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #000;
    color: #fff;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

a {
    color: #fff;
    text-decoration: none;
}

a:hover {
    color: #c0a96e;
}

/* 导航栏 */
.navbar {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    border-bottom: 1px solid #333;
}

.navbar .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #c0a96e;
}

.navbar .nav-links {
    display: flex;
    gap: 2rem;
}

.navbar .nav-links a {
    color: #fff;
    transition: color 0.3s;
}

.navbar .nav-links a:hover {
    color: #c0a96e;
}

/* 页脚 */
.footer {
    background: #0a0a0a;
    padding: 2rem;
    text-align: center;
    color: #666;
    border-top: 1px solid #333;
}

/* 主内容区域 */
.map-wrapper {
    flex: 1;
    display: flex;
    overflow: hidden;
    height: 100%;
    width: 100%;
}

/* 主容器 */
.container {
    display: flex;
    height: 100%;
    width: 100%;
}

/* 左侧筛选栏 */
.sidebar {
    width: 350px;
    background: #0a0a0a;
    border-right: 1px solid #333;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, width 0.3s ease;
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: 0;
    transform: translateX(-350px);
    border-right: none;
    padding: 0;
    overflow: hidden;
}

/* 地图容器 */
.map-container {
    flex: 1;
    position: relative;
    min-width: 0;
    transition: flex 0.3s ease;
}

#map {
    width: 100%;
    height: 100%;
}

/* 当侧边栏收起时，地图容器占据全部空间 */
.sidebar.collapsed ~ .map-container {
    flex: 1;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #333;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    color: #c0a96e;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.5rem;
}

/* 筛选区块 */
.filter-section {
    margin-bottom: 1.5rem;
}

.filter-section h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #c0a96e;
}

.filter-section label {
    display: block;
    margin-bottom: 0.5rem;
    color: #ccc;
    font-size: 0.9rem;
}

.filter-section select,
.filter-section input[type="text"],
.filter-section input[type="date"] {
    width: 100%;
    padding: 0.5rem;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #fff;
    border-radius: 4px;
    font-size: 0.9rem;
}

.filter-section select:focus,
.filter-section input:focus {
    outline: none;
    border-color: #c0a96e;
}

/* 标签复选框 */
.tags-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tag-checkbox {
    display: none;
}

.tag-label {
    padding: 0.25rem 0.75rem;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.tag-checkbox:checked + .tag-label {
    background: #c0a96e;
    color: #000;
    border-color: #c0a96e;
}

/* 分类标签筛选器 */
.tags-filter-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 1rem;
}

.tags-title {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: #c0a96e;
    flex-shrink: 0;
}

.tag-category-box {
    border: 1px solid #333;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.tag-category-toggle {
    width: 100%;
    padding: 8px 10px;
    background: #1a1a1a;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: #c0a96e;
    font-size: 0.85rem;
    transition: background 0.2s;
    text-align: left;
    gap: 4px;
}

.tag-category-toggle:hover {
    background: #242424;
}

.tag-category-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tag-count {
    color: #999;
    font-weight: normal;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.tag-category-content {
    display: none;
    padding: 8px;
    background: #0a0a0a;
    border-top: 1px solid #333;
    max-height: 200px;
    overflow-y: auto;
}

.tag-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tag-item-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 5px 6px;
    border-radius: 3px;
    transition: background 0.2s;
    user-select: none;
    font-size: 0.85rem;
}

.tag-item-label:hover {
    background: rgba(192, 169, 110, 0.1);
}

.tag-item-label input[type="checkbox"] {
    cursor: pointer;
    width: 14px;
    height: 14px;
    accent-color: #c0a96e;
    flex-shrink: 0;
}

.tag-item-label span {
    color: #ccc;
    font-size: 0.85rem;
    word-break: break-word;
}

/* 范围滑块 */
.range-slider {
    margin: 0.5rem 0;
}

.range-slider input[type="range"] {
    width: 100%;
    margin: 0.25rem 0;
}

.range-label {
    text-align: center;
    font-size: 0.9rem;
    color: #c0a96e;
}

/* 预设筛选按钮 */
.preset-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.preset-btn {
    padding: 0.5rem;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.preset-btn:hover {
    background: #c0a96e;
    color: #000;
}

/* 操作按钮 */
.filter-actions {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

.btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.btn-primary {
    background: #c0a96e;
    color: #000;
}

.btn-primary:hover {
    background: #d4b978;
}

.btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid #c0a96e;
}

.btn-outline:hover {
    background: #c0a96e;
    color: #000;
}

/* 侧边栏页脚(沉底） */
.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #333;
    flex-shrink: 0;
}

/* 统计信息 */
.stats {
    display: flex;
    gap: 1rem;
    justify-content: space-around;
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stats .count {
    font-size: 1.5rem;
    font-weight: bold;
    color: #c0a96e;
}

.stats .label {
    font-size: 0.8rem;
    color: #999;
    margin-top: 0.3rem;
}

/* 侧边栏切换按钮 */
.sidebar-toggle-btn {
    position: absolute;
    left: 350px;
    top: 50%;
    transform: translateY(-50%);
    background: #c0a96e;
    border: none;
    padding: 1rem 0.5rem;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    z-index: 999;
    transition: left 0.3s;
}

.sidebar-toggle-btn.collapsed {
    left: 0;
    border-radius: 0 8px 8px 0;
}

/* 返回顶部导航 */
.back-nav {
    position: fixed;
    top: 1rem;
    left: 1rem;
    background: rgba(0, 0, 0, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    z-index: 1000;
}

/* 响应式 */
@media (max-width: 768px) {
    .map-wrapper {
        flex-direction: column;
        height: auto;
    }

    .sidebar {
        width: 100%;
        height: auto;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid #333;
        transform: translateY(0) !important;
    }

    .sidebar.collapsed {
        width: 100%;
        max-height: 0;
        padding: 0;
        overflow: hidden;
        transform: translateY(-100%) !important;
        border-bottom: none;
    }

    .sidebar-toggle-btn {
        position: fixed;
        bottom: 50vh;
        left: 50%;
        top: auto;
        transform: translateX(-50%);
        padding: 0.5rem 1rem;
        border-radius: 8px 8px 0 0;
    }

    .sidebar-toggle-btn.collapsed {
        bottom: 0;
        border-radius: 8px 8px 0 0;
    }

    .navbar {
        flex-direction: column;
        gap: 1rem;
    }
}
