:root{
    --menu-pos-left:0px;
    --menu-pos-top:0px;
    --editor-left:0px;
    --editor-top:0px;
    --ui-width:500px;
    --ui-height:500px;
    --canvas-cursor:default;
    --text-editor-width:170px
}
.vis-f-g{
    position: relative;
    
    display: flex;
}

/* fix bootstrap*/
.vis-f-g input{
    box-sizing: unset !important;
}
.vis-f-g input[type=checkbox]{
    margin: 0px !important;
}

.vis-f-g label{
    margin-bottom: 0px !important;
}

vis-f-g-tool-bar{
    display: flex;
    margin: 10px;
    position: absolute;
    top: 0px;
    left: calc(var(--ui-width) - 220px);
}
vis-f-g-tool-bar::before{
    content: " ";
    flex-grow: 1;
}
vis-f-g-tool-bar>div:first-child{
    display: block;
    flex-grow: 1;
}
.edit-btn:hover::after{
    position: absolute;
    background-color: #fff;
    color: #000;
    border: 1px solid #000;
    width: max-content;
    margin-top: 10px;
    margin-left: -10px;
}
.edit-btn{
    border-style: outset;
    background-color: #efefef;
    font-size: 12px;
    height: 20px;
    width: 20px;
    border-color: #cccccc;
    outline: none;
    background-repeat: round;
}
.edit-btn.active-btn{
    border-style: inset;
}
.edit-btn:active{
    border-style: inset;
}
.pencil-btn{
    border-style: inset;
    background-image: url("./images/pencil.png");
}
.pencil-btn:hover::after{
    content: "切為家系圖";
}
.family-btn{
    border-style: outset;
    background-image: url("./images/family.png");
}
.family-btn:hover::after{
    content: "切為畫筆";
}

.erase-btn{
    background-image: url("./images/eraser.png");
}
.erase-btn:hover::after{
    content: "清除線條";
}


.line-btn{
    background-image: url("./images/line.png");
}
.line-btn:hover::after{
    content: "線條工具";
}

.move-btn{
    background-image: url("./images/move.png");
}
.move-btn:hover::after{
    content: "移動工具";
}

.undo-btn{
    background-image: url("./images/undo.png");
}
.undo-btn:hover::after{
    content: "復原";
}
.redo-btn{
    background-image: url("./images/redo.png");
}
.redo-btn:hover::after{
    content: "取消復原";
}
.download-btn{
    background-image: url("./images/download.png");
}
.download-btn:hover::after{
    content: "下載";
}
.save-btn{
    background-image: url("./images/save.png");
}
.save-btn:hover::after{
    content: "儲存";
}
.config-btn{
    background-image: url("./images/config.png");
}
.config-btn:hover::after{
    content: "設定";
}

.list-btn{
    background-image: url("./images/list.png");
}
.list-btn:hover::after{
    content: "編輯";
}

vis-f-g-canvas{
    display: block;
    /*position: absolute;*/
    border: #333333 solid;
    width: var(--ui-width);
    height: var(--ui-height);
}

.vis-f-g-canvas{
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #fff;
    cursor: var(--canvas-cursor);
}


canvas.drawing
{
    cursor :url(./images/pencil_cursor.png), AUTO !important;
} 


.vis-f-g-edit-container{
    
    width: 130px;
    height: auto;
    padding: 0px;
    position: absolute;
    left: var(--editor-left);
    top: var(--editor-top);
}

.vis-f-g-edit-container-bg{
    background-color: #eeec;
    border: 1px solid #dddddd;
}
.vis-f-g-editor .v-header{
    font-size: 14px;
    background-color: #e0d8ff;
    padding:0px 5px;
    height: 22px;
}
.vis-f-g-editor>div:not(.v-header,.text-editor){
    margin:3px 0px;
    font-size: 12px;
    padding:0px 5px;
    display: flex;
    height: 22px;
    align-items: center;
}
.vis-f-g-editor>div>div:first-child:not(.input-container){
    min-width: 35px;
    font-size: 14px;
    flex-grow: 1;
}
.vis-f-g-editor>div>div:not(.v-panel){
    flex-grow: 1;
    display: flex;
    align-items: center;
}
.vis-f-g-editor hr{
    padding: 0px;
    margin: 0px;
}
.vis-f-g-editor input[type="radio"]{
    margin: 0px;
}
.vis-f-g-editor label{
    font-size: 10px;
}
.vis-f-g-editor input{
    font-size: 14px;
    outline: none;
    line-height: unset !important;
    height: 14px
}
.vis-f-g-editor button:not(.delete-btn, .text-editor button){
    flex-grow: 1;
    margin: 0px 25%;
}
.vis-f-g-editor button.delete-btn{
    width: 20px;
    padding: 0px;
    position:absolute;
    top:0px;
    right:2px
}

.vis-f-g-editor-remark>input{
    height: 16px;
    flex-grow: 1;
    min-width: 0px;
    border-color: #eeeeee;
}
.vis-f-g-editor-age::before{
    content: "顯示";
}
.vis-f-g-editor-age::after{
    content: "歲";
}
.vis-f-g-editor-age input[type="number"]{
    width: 50px;
    text-align: right;
}

.vis-f-g-editor-state>div{
    flex-grow: 1;
}
.vis-f-g-editor-state input{
    margin: 2px 0px 2px 0px;
}

.vis-f-g-spouse-editor{
    position: absolute;
    left: 0px;
    top: 0px;
    width: 100%;
    height: 100%;
}
.vis-f-g-spouse-editor .mask{
    position: absolute;
    left: 0px;
    top: 0px;
    width: 100%;
    height: 100%;
    background-color: #333333;
    opacity: 0.8;
}
.vis-f-g-spouse-editor .v-panel{
    font-size: 14px;
    position: absolute;
    left: 150px;
    top: 150px;
    width: 200px;
    height: auto;
    background-color: #ffffff;
    opacity: 1; 
    padding: 0px;
}

.vis-f-g-spouse-editor .v-panel .v-header{
    display: flex;
    background-color: #e0d8ff;
    padding: 5px;
}
.vis-f-g-spouse-editor .v-panel .v-header .text{
    flex-grow: 1;
}
.vis-f-g-spouse-editor .v-panel .v-header .close-btn{
    min-width: 20px;
}
.vis-f-g-spouse-editor .v-panel .v-body{
    padding: 5px;
}
.vis-f-g-spouse-editor .v-panel .v-body>div{
    display: flex;
    height: 20px;
    margin-bottom: 3px;
}

.vis-f-g-spouse-editor .v-panel .v-body>div>div:first-child{
    min-width: 40px;
}
.vis-f-g-spouse-editor .v-panel .v-body>div>*:not(:first-child){
    min-width: 0px;
    flex-grow: 1;
}
.vis-f-g-spouse-editor .input-container{
    flex-grow: 1;
}


.vis-f-g-spouse-editor .v-panel .v-footer, .text-editor .v-panel .v-footer{
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 5px;
}
.vis-f-g-spouse-editor .v-panel .v-footer button{
    width: 60px;
}

.open-on-cursor{
    position: absolute;
    top: var(--menu-pos-top);
    left: var(--menu-pos-left);
}
.vis-f-g-context-menu>div{
    display: grid;
    border: 1px solid #888;
    padding: 2px;
    width: 80px;
}

.hidden{
    display: none !important;
}

.text-editor{
    display: block !important;
    width: 160px;
    /* margin-top: -6px;
    margin-left: -3px; */
    
    margin-left: calc((var(--text-editor-width) / -2) - 1px);
    margin-top: -1px;
    margin-bottom: -1px;
    margin-right: -1px;
}
.text-editor textarea{
    width: var(--text-editor-width);
    overflow-x: auto;
    line-height: 18px;
    font-size: 14px;
    font-family: Arial;
    height: 20px;
}
.config-panel{
    /*position: absolute;
    right: 0px;
    top: 32px;*/
    border: 1px #555 solid;
    width: 130px;
    background-color: #ddd4;
    font-size: 12px;
}
.config-panel input{
    min-width: 0px;
    flex-grow: 1;
    height: 14px;
}
.config-panel .setting-box>div{
    display: flex;
}
.config-panel .setting-box>div>div:first-child{
    min-width: 60px;
}
.config-panel .setting-title{
    font-size: 13px;
    padding: 2px 0px;
    cursor: pointer;
    text-align: center;
    background-color: rgb(117, 144, 155);
    color: #eff;
    
    font-family: '標楷體';
    border-bottom: 1px solid #444;
}

.vis-f-g-editor .vis-f-g-text-border{
    display: flex;
    align-items: center;
    background-color: #fffa;
}
.vis-f-g-editor .vis-f-g-text-border::before{
    content: '外框：';
    font-size: 12px;
    
}
.vis-f-g-editor .vis-f-g-text-border input{
    max-width: 15px;
    height: 20px;
    margin-right: 25px;
}
.vis-f-g-editor .vis-f-g-text-border input[value=none]::after{
    content: '無';
    margin-left: 15px;
}
.vis-f-g-editor .vis-f-g-text-border input[value=rect]::after{
    content: '方';
    margin-left: 15px;
}
.vis-f-g-editor .vis-f-g-text-border input[value=circle]::after{
    content: '圓';
    margin-left: 15px;
}
.vis-f-g-text-area-border{
    vertical-align:middle;
    text-align: center;
    
    background-color: #fffa;
    width: fit-content;
    position: relative;
    display: flex;
}
.vis-f-g-text-area-border.border-rect{
    border: 1px solid black;
}
.vis-f-g-text-area-border.border-circle{
    border: 1px solid black;
    border-radius: 50% 50%;
}
.vis-f-g-text-area-border textarea{
    background-color: transparent;
    width: 100%;
    border:none;
    outline: none;
    text-align: center;
    padding: 0px;
    font-family:monospace;
}
.vis-f-g-text-area-border textarea:not(.readonly){
    position: absolute;
    resize: none;
    left: 10px;
    width: calc(100% - 20px);
    /* 垂直置中*/
    margin: auto;
    top: 0px;
    bottom: 0px;
}


vis-f-g-table{
    
    left: 100%;
    
    top: 0px;
    width: 500px;
    border: 1px solid black;
    display: table;
    user-select: none;
}
vis-f-g-table  th, vis-f-g-table td{
    border: 1px solid #444;
    height: 30px;
    text-align: center;
}
vis-f-g-table tbody{
    display: block;
    max-height: 500px;
    
    overflow-y: scroll;
}


vis-f-g-table thead, vis-f-g-table tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;/* even columns width , fix width of table too*/
}

vis-f-g-table tbody tr{
    background-color:white;
}
vis-f-g-table tbody tr:hover{
    background-color: #ddd;
}
vis-f-g-table tbody tr.tr_hover{
    background-color: #ddd;
}

.v-f-g-table-target{
    width: 125px;
    padding-left: 5px;
}
td.v-f-g-table-target{
    text-align: left;
    cursor:default;
}
.v-f-g-table-relation{
    width: 80px;
}
td.v-f-g-table-relation{
    
    overflow: hidden;
    text-overflow: ellipsis;
    white-space:nowrap;
    min-width: none;
    text-align: center;
    cursor:default;
}

.v-f-g-table-desc{
    width: 100px;
    text-align: center;
}
td.v-f-g-table-desc input{
    align-self: center;
    width: calc(100% - 10px);
    min-width: none;
    outline: none;
    height: calc(100% - 10px);    
}

.v-f-g-table-sex{
    width: 70px;
}
td.v-f-g-table-sex{
    text-align: center;
}

td.v-f-g-table-sex label{
    font-weight: normal;
    font-size: 14px;
}
td.v-f-g-table-sex label:not(:last-child){
    margin-right: 3px;
}
.v-f-g-table-age{
    width: 70px;
}
td.v-f-g-table-age{
    display: flex;
    align-items: center;
    text-align: center;
}
td.v-f-g-table-age input{
    width: 40px;
    text-align: center;
    outline: none;
    height: calc(100% - 10px);
}
/* 調整數字上下箭頭的寬度 */
/* .v-f-g-table-age input[type=number]:hover::-webkit-inner-spin-button{
    cursor: default;
    scale: 0.5 1;
    margin-left:-8px;
    left:5px;
    top:0px;
    position:relative;
    display:unset;
} */
/* 隱藏數字上下箭頭 */
.v-f-g-table-age input[type=number]::-webkit-inner-spin-button{
    display:none;
}

.v-f-g-table-state{
    width: 65px;
}
td.v-f-g-table-state{
    
    text-align: center;
}
td.v-f-g-table-state select{
    width: 100%;
    text-align: center;
    outline: none;
    border: none;
}

.v-f-g-table-marry{
    width: 65px;
}
td.v-f-g-table-marry{
    
    text-align: center;
}
td.v-f-g-table-marry select{
    width: 100%;
    text-align: center;
    outline: none;
    border: none;
}
.v-f-g-table-action{
    width: 85px;
}
td.v-f-g-table-action button{
    margin-left: 3px;
    max-width: 50%
}
.v-f-g-table-delete{
    width: 90px;
}
td.v-f-g-table-delete{
    
    text-align: center;
    border-right: none;
}
th.v-f-g-table-delete{
    border-right: none;
}
.v-f-g-table-scroller{
    width: 5px;
}
th.v-f-g-table-scroller{
    border-bottom: none;
    border-top: none;
    border-right: none;
    background: #eee;
}
td.v-f-g-table-scroller{
    width: 0px;
    border-top: none;
    border-right: none;
    
    border-bottom: none;
    background: #eee;
}
vis-f-g-table tbody::-webkit-scrollbar{
    width: 5px;
    background: white;
    
}
vis-f-g-table tbody::-webkit-scrollbar{
    width: 5px;
    background: white;
}
vis-f-g-table tbody::-webkit-scrollbar:disabled{
    position: absolute;
    width: 5px;
    z-index: 99;
    background: transparent;
    border: none;
    background: #eee;
}
vis-f-g-table tbody::-webkit-scrollbar-thumb{
    background: #bbb;
    border-radius: 4px;
}

.visible-icon{
    visibility: visible !important; /*避免被Bootstrap蓋掉*/
    margin-left: 2px;
    width: 16px;
    height: 16px;
    background-image: url("./images/invisible.png");
    cursor: pointer;
    background-repeat: round;
}
.visible-icon.visible{
    background-image: url("./images/visible.png");
}

.visible-icon.invisible{
    
    background-image: url("./images/invisible.png");
}