* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: sans-serif;
    background-color: #d6d6d7;
    overflow: hidden;
}

#container {
    position: relative;
    width: 100vw;
    height: 100vh;
    min-width: 1024px;
    min-height: 768px;
}

/* 地图模块样式 */
#map-sector {
    z-index: 1;
    position: absolute;
    width: 59vw;
    height: 100vh;
    bottom: 0;
    left: 0;
}

.map-container {
    z-index: 0;
    position: absolute;
    width: 90%;
    height: 90%;
    left: 8%;
    bottom: 8%;
}

#china-map {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: url('../images/map.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

/* 右上模块样式 */
#rt-sector {
    position: absolute;
    right: 2vw;
    top: 8vh;
    width: 38vw;
    height: 24vh;
    min-width: 380px;
    min-height: 200px;
}

.title-container {
    display: flex;
    align-items: center;
    height: 28px;
    margin-left: 38px;
    margin-bottom: 10px;
}

.title-container p {
    margin-left: 10px;
    font-size: clamp(18px, 2vw, 24px);
    text-align: left;
    font-weight: bold;
}

.area-badge {
    text-align: center;
    height: 28px;
    width: 80px;
    padding: 4px 10px;
    margin-left: 20px;
    background-color: #6E93C9;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: clamp(14px, 1.2vw, 16px);
    line-height: 20px;
}

.area-badge:hover {
    background-color: #5470C6;
}

.section-container {
    position: absolute;
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.content-box {
    display: flex;
    height: 80%;
    margin-left: 0px;
    margin-bottom: 0px;
    background-color: white;
    border-radius: 30px;
    box-shadow: 0px 2px 8px #5470C6;
}

.title-block {
    width: 12px;
    height: 28px;
    background-color: #0A336C;
}

.gender-chart {
    width: 45%;
    height: 180px;
    min-height: 150px;
}

.community-stats {
    width: 45%;
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

.community-title {
    margin-top: 2px;
    text-align: center;
    color: #333333;
    font-size: clamp(24px, 2.5vw, 32px);
    font-weight: bold;
}

.community-data-container {
    display: flex;
    align-items: flex-end;
}

.community-main-data {
    width: fit-content;
    font-size: clamp(40px, 5vw, 50px);
    text-align: center;
    font-weight: bold;
    color: #0A336C;
}

/* 右下模块样式 */
#rb-sector {
    position: absolute;
    right: 2%;
    bottom: 1%;
    width: 38%;
    height: 60%;
    min-width: 380px;
    min-height: 400px;
}

.rb-title-container {
    display: flex;
    align-items: center;
    width: fit-content;
    margin-left: 38px;
    margin-bottom: 10px;
}

.rb-content-box {
    display: flex;
    margin-top: 0px;
    height: 80%;
    background-color: #fff;
    border-radius: 30px;
    box-shadow: 0px 2px 8px #5470C6;
}

.age-structure {
    display: flex;
    flex-direction: column;
    position: absolute;
    width: 100%;
    height: 100%;
    padding: 20px;
}

.age-title {
    font-size: clamp(18px, 2vw, 24px);
    display: center;
    font-weight: bold;
    color: #353434;
    margin-left: 10px;
    text-align: center;
    width: 100%;
}

.age-chart {
    width: 100%;
    height: calc(100% - 30px);
}

/* 响应式调整 - 平板设备 */
@media (max-width: 1200px) {
    #container {
        min-width: 768px;
    }
    
    #rt-sector {
        width: 35vw;
        top: 12vh;
    }
    
    #rb-sector {
        width: 35vw;
    }
    
    .community-title {
        font-size: clamp(20px, 2vw, 28px);
    }
    
    .community-main-data {
        font-size: clamp(36px, 4vw, 45px);
    }
}

/* 响应式调整 - 小屏幕设备 */
@media (max-width: 900px) {
    #container {
        min-width: 600px;
    }
    
    #map-sector {
        width: 55vw;
    }
    
    #rt-sector {
        width: 42vw;
        right: 1vw;
        top: 10vh;
    }
    
    #rb-sector {
        width: 42vw;
        right: 1vw;
        bottom: 2vh;
    }
    
    .title-container {
        margin-left: 20px;
    }
    
    .rb-title-container {
        margin-left: 20px;
    }
    
    .content-box, .rb-content-box {
        border-radius: 20px;
    }
}

/* 响应式调整 - 移动设备 (竖屏) */
@media (max-width: 768px) and (orientation: portrait) {
    #container {
        height: auto;
        min-height: 100vh;
        min-width: 320px;
        overflow-y: auto;
    }
    
    #map-sector {
        position: relative;
        width: 100vw;
        height: 50vh;
        margin-bottom: 20px;
    }
    
    .map-container {
        width: 95%;
        height: 95%;
        left: 2.5%;
        bottom: 2.5%;
    }
    
    #rt-sector {
        position: relative;
        width: 90vw;
        height: 30vh;
        left: 5vw;
        right: auto;
        top: auto;
        margin-bottom: 20px;
    }
    
    #rb-sector {
        position: relative;
        width: 90vw;
        height: 50vh;
        left: 5vw;
        right: auto;
        bottom: auto;
        margin-bottom: 20px;
    }
    
    .content-box, .rb-content-box {
        height: 85%;
    }
    
    .section-container {
        flex-direction: column;
    }
    
    .community-stats {
        width: 100%;
        height: 50%;
    }
    
    .gender-chart {
        width: 100%;
        height: 50%;
    }
}

/* 响应式调整 - 移动设备 (横屏) */
@media (max-width: 900px) and (orientation: landscape) {
    #container {
        min-width: 600px;
    }
    
    #map-sector {
        width: 50vw;
    }
    
    #rt-sector {
        width: 48vw;
        height: 30vh;
        top: 5vh;
    }
    
    #rb-sector {
        width: 48vw;
        height: 55vh;
        bottom: 5vh;
    }
    
    .content-box, .rb-content-box {
        border-radius: 15px;
    }
}

/* 高分辨率屏幕优化 */
@media (min-width: 1920px) {
    #rt-sector, #rb-sector {
        width: 36vw;
    }
    
    .title-container p {
        font-size: 28px;
    }
    
    .community-title {
        font-size: 36px;
    }
    
    .community-main-data {
        font-size: 56px;
    }
}

/* 超宽屏优化 */
@media (min-width: 2560px) {
    #map-sector {
        width: 55vw;
    }
    
    #rt-sector, #rb-sector {
        width: 30vw;
    }
    
    .content-box, .rb-content-box {
        border-radius: 40px;
    }
}
