/* map_redesign.css */

/* 重写 Map Page 布局为 Flex Column */
#map-page {
    /* display: none; */ /* JS控制显隐，由 app.js 的 showPage 设置 display: flex */
    flex-direction: column !important; /* 强制覆盖 */
    height: 100vh;
    width: 100vw;
    background-color: #1a1a2e;
    overflow: hidden;
    padding: 0 !important; /* 移除原来的 padding */
}

/* 顶部栏 */
.map-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    padding: 0 20px;
    background: linear-gradient(to bottom, #1a1a2e, #0f0f1a);
    border-bottom: 2px solid #444;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 1000;
    flex-shrink: 0; /* 防止被挤压 */
    position: relative;
    width: 100%;
    box-sizing: border-box; /* 包含 padding */
}

/* 左侧：返回 + 标题 */
.map-top-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1; /* 占 1/3 */
}

.map-back-btn-text {
    background: none;
    border: none;
    color: #ccc;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.2s;
}

.map-back-btn-text:hover {
    color: #fff;
    border-color: #666;
    background: rgba(255,255,255,0.1);
}

.map-top-title {
    color: #ffd700;
    font-size: 22px;
    margin: 0;
    font-family: serif;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

/* 中间：San值容器 */
.map-top-center {
    flex: 1; /* 占 1/3 */
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 320px; /* 保证 San UI 足够宽 */
    /* DEBUG STYLE - 确认是否占据空间 */
    /* border: 1px dashed red; */
    height: 100%;
}

/* 确保内部的 san-widget-container 正常显示 */
.map-top-center .san-widget-container {
    transform: scale(0.9); /* 稍微缩小适应高度 */
}

/* 右侧：功能按钮 */
.map-top-right {
    display: flex;
    gap: 12px;
    flex: 1; /* 占 1/3 */
    justify-content: flex-end;
    align-items: center;
}

/* 功能按钮样式 */
.map-icon-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(180deg, #3a3a50, #2a2a40);
    border: 1px solid #555;
    border-radius: 4px;
    padding: 6px 12px;
    color: #ddd;
    cursor: pointer;
    font-size: 14px;
    height: 36px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: all 0.2s;
    min-width: 80px;
    justify-content: center;
}

.map-icon-btn:hover {
    background: linear-gradient(180deg, #4a4a60, #3a3a50);
    border-color: #888;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.map-icon-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.map-icon-btn .icon {
    font-size: 16px;
}

/* 地图全屏容器 */
#map-wrapper {
    flex: 1; /* 占据剩余高度 */
    width: 100%;
    position: relative;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* 防止原生滚动条，内部可能需要自实现平移缩放 */
}

/* 强制覆盖 map.css 中的容器样式，使其适应新布局 */
#map-wrapper .map-container {
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    position: relative !important;
    /* 如果原JS设定了固定宽高，这里可能需要后续在JS里适配，或者允许它居中显示 */
}

/* 隐藏地图页面的旧元素（仅限map-page） */
#map-page .map-function-bar,
#map-page .map-header {
    display: none !important;
}
