body {
    background: #000 url(../img/bg.png) no-repeat center;
    text-align: center;
    user-select: none;
}

/* 设置button的一点样式 */
button {
    background-color: #fff;
    border: none;
    padding: 5px 10px;
    box-shadow: 0 0 10px 0 #ccc;
}

/* 修改图片区域 */
#modify-area {
    display: block;
    margin-top: 100px;
}

#modify-area.hide {
    /* 隐藏  修改图片区域 */
    display: none;
}

/* 存放预览图片、帽子的父元素 */
#avatar {
    width: 300px;
    height: 300px;
    position: relative;
    margin: auto;
    overflow: hidden;
}

#avatar #avatar_img {
    width: 300px;
    height: 300px;
}

#avatar #avatar_template {
    width: 100%;
    height: 100%;
}

#hatBox {
    width: 100px;
    position: absolute;
}

#hatBox #rotateImg {
    display: none;
    position: absolute;
    left: 50%;
    margin-left: -10px;
    top: -30px;
    width: 20px;
    height: 20px;
    background-image: url('../img/rotate.png');
    background-size: 100% 100%;
}

#hatBox #rotateImg.active {
    /* 展示  旋转图标 */
    display: block;
}

#hatBox #spreadImg {
    display: none;
    position: absolute;
    right: -10px;
    top: calc(100% - 10px);
    width: 20px;
    height: 20px;
    background-image: url('../img/spread.png');
    background-size: 100% 100%;
}

#hatBox #spreadImg.active {
    /* 展示  缩放图标 */
    display: block;
}

/* 最后图片区域 */
#result-area {
    display: none;
}

#result-area.active {
    /* 展示   最后图片区域 */
    display: block;
}

#result-img {
    width: 300px;
    height: 300px;
}

#tips {
    color: #fff;
    font-size: 20px;
}