//->REM
~function () {
    var desW = 750,
        winW = document.documentElement.clientWidth,
        ratio = winW / desW,
        oMain = document.querySelector('.main');
    if (winW > desW) {
        oMain.style.margin = '0 auto';
        oMain.style.width = desW + 'px';
        return;
    }
    document.documentElement.style.fontSize = ratio * 100+ 'px';


    //加减号
    function Show_Hidden1(obj,obj2,obj3,obj4) {
        if(obj.style.display=="block")
        {
            obj.style.display='none';
            obj2.style.borderBottom='1px solid #ccc';
            obj3.style.webkitAnimation="rotateIn 1s 0s both";
            obj3.style.animation="rotateIn 1s 0s both";
            obj3.innerHTML="+";
            obj3.style.fontSize="24px";
            obj3.style.width=".17rem"
            obj3.style.marginRight=".68rem";
            obj4.style.borderTop='none';
        }
        else
        {

            obj.style.display='block';
            obj4.style.borderTop='1px solid #ccc';
            obj2.style.borderBottom='none';
            obj3.style.webkitAnimation="rotateIn 1s 0s both";
            obj3.style.animation="rotateIn 1s 0s both";
            obj3.innerHTML="-";
            obj3.style.fontSize="24px";
            obj3.style.width=".17rem"
            obj3.style.marginRight=".55rem";

        }
    }
    function Show_Hidden2(obj,obj2,obj3,obj4) {
        if(obj.style.display=="block")
        {
            obj.style.display='none';
            obj2.style.borderBottom='1px solid #ccc';
            obj3.style.webkitAnimation="rotateIn 1s 0s both";
            obj3.style.animation="rotateIn 1s 0s both";
            obj3.innerHTML="+";
            obj3.style.fontSize="24px";
            obj3.style.width=".17rem"
            obj3.style.marginRight=".68rem";
            obj4.style.borderTop='none';
        }
        else
        {
            obj.style.display='block';
            obj2.style.borderBottom='none';
            obj3.style.webkitAnimation="rotateIn 1s 0s both";
            obj3.style.animation="rotateIn 1s 0s both";
            obj3.innerHTML="-";
            obj3.style.fontSize="24px";
            obj3.style.width=".17rem"
            obj3.style.marginRight=".55rem";
            obj4.style.borderTop='1px solid #ccc';

        }
    }
    function Show_Hidden3(obj,obj2,obj3,obj4) {
        if(obj.style.display=="block")
        {
            obj.style.display='none';
            obj2.style.borderBottom='1px solid #ccc';
            obj3.style.webkitAnimation="rotateIn 1s 0s both";
            obj3.style.animation="rotateIn 1s 0s both";
            obj3.innerHTML="+";
            obj3.style.fontSize="24px";
            obj3.style.marginRight=".68rem";
            obj4.style.borderTop='none';

        }
        else
        {
            obj.style.display='block';
            obj2.style.borderBottom='none';
            obj3.style.webkitAnimation="rotateIn 1s 0s both";
            obj3.style.animation="rotateIn 1s 0s both";
            obj3.innerHTML="-";
            obj3.style.width=".17rem"
            obj3.style.fontSize="24px";
            obj3.style.marginRight=".55rem";
            obj4.style.borderTop='1px solid #ccc';

        }
    }
    function Show_Hidden4(obj,obj2,obj3,obj4) {
        if(obj.style.display=="block")
        {
            obj.style.display='none';

            //加号动画
            obj3.style.webkitAnimation="rotateIn 1s 0s both";
            obj3.style.animation="rotateIn 1s 0s both";
            obj3.innerHTML="+";

            obj3.style.fontSize="24px";
            obj3.style.marginRight=".68rem";
            obj2.style.borderBottom='1px solid #ccc';

        }
        else
        {
            obj.style.display='block';
            obj.style.marginBottom='0';
            obj2.style.borderBottom='none';
            obj3.style.webkitAnimation="rotateIn 1s 0s both";
            obj3.style.animation="rotateIn 1s 0s both";
            obj3.innerHTML="-";
            obj3.style.width=".17rem";
            obj3.style.fontSize="24px";
            obj3.style.marginRight=".55rem";
            // obj2.style.borderBottom='none';


        }
    }

    //每一个整体
    var character1=document.getElementById("character-1");
    var character2=document.getElementById("character-2");
    var character3=document.getElementById("character-3");
    var character4=document.getElementById("character-4");
    //加号
    var characterA =document.getElementById("character-1-a");
    var characterA2 =document.getElementById("character-2-a");
    var characterA3 =document.getElementById("character-3-a");
    var characterA4 =document.getElementById("character-4-a");
    //展开部分
    var characterUnfold=document.getElementById("character-1-unfold");
    var characterUnfold2=document.getElementById("character-2-unfold");
    var characterUnfold3=document.getElementById("character-3-unfold");
    var characterUnfold4=document.getElementById("character-4-unfold");



    character1.onclick=function onclick1() {
        Show_Hidden1(characterUnfold,character1,characterA,character2);

    }
    character2.onclick=function onclick2() {
        Show_Hidden2(characterUnfold2,character2,characterA2,character3);

    }
    character3.onclick=function onclick3() {
        Show_Hidden3(characterUnfold3,character3,characterA3,character4);

    }
    character4.onclick=function onclick4() {
        Show_Hidden4(characterUnfold4,character4,characterA4);

    }


}();