//兼容ie8
@mixin max-screen($res) {
    @media only screen and (max-width: $res) {
        @content;
    }
}

.obelisk-form, .ob-form {
    .input-text {
        padding-left: 10px;
        padding-right: 10px;
        padding-top: 6px;
        padding-bottom: 6px;
        border: 1px solid #ced3d9;
        border-radius: 3px;
        color: #222;
        vertical-align: middle;
        line-height: 16px;
        font-size: 12px;
        background-color: #fff;
        margin-right: 10px;
        height: 30px;
        *height: 16px;
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        -ms-box-sizing: border-box;
        -o-box-sizing: border-box;
        box-sizing: border-box;
        &:hover {
            border-color: #a1aab2;
            outline: 0;
        }
        &:focus {
            border-color: #1470cc;
            outline: 0;
        }
        &.error {
            border-color: #e64545;
        }
        &[disabled],
        &.disabled {
            border-color: #ced3d9;
            background-color: #edf0f2;
            cursor: not-allowed;
        }
    }
    .text-item {
        display: inline-block;
        *display: inline;
        *zoom: 1;
        vertical-align: middle;
        margin-right: 10px;
        position: relative;
        .input-wrap {
            overflow: hidden;
        }
        .input-head {
            padding: 0px 10px;
            height: 28px;
            text-align: center;
            line-height: 28px;
            color: #555;
            float: left;
            border-right: 1px solid #ced3d9;
            -webkit-border-radius: 3px 0 0 3px;
            -moz-border-radius: 3px 0 0 3px;
            -ms-border-radius: 3px 0 0 3px;
            -o-border-radius: 3px 0 0 3px;
            border-radius: 3px 0 0 3px;
            position: relative;
            z-index: 9;
            top: 1px;
            *top: 0;
        }
        .input-ctnr {
            width: 100%;
            height: 100%;
            border-radius: 3px;
            border: 1px solid #ced3d9;
            background-color: #f5f7fa;
            position: absolute;
            left: 0;
            top: 0;
            *height: 28px;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            -ms-box-sizing: border-box;
            -o-box-sizing: border-box;
            box-sizing: border-box;
        }
        .input-cnt {
            overflow: hidden;
            input {
                width: 100%;
            }
        }
        .input-text {
            -webkit-border-radius: 0 3px 3px 0;
            -moz-border-radius: 0 3px 3px 0;
            -ms-border-radius: 0 3px 3px 0;
            -o-border-radius: 0 3px 3px 0;
            border-radius: 0 3px 3px 0;
            float: right;
            border-left: 0;
            margin-right: 0;
            position: relative;
            z-index: 9;
            &:hover + .input-ctnr {
                border-color: #a1aab2;
            }
            &:focus + .input-ctnr {
                border-color: #1470cc;
            }
            &.error + .input-ctnr {
                border-color: #e64545;
            }
            &[disabled] + .input-ctnr,
            &.disabled + .input-ctnr {
                border-color: #ced3d9;
                background-color: #edf0f2;
                cursor: not-allowed;
            }
        }
    }
    .input-checkbox,
    .input-radio,
    .input-toggle,
    .input-tag {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        .input-wrap {
            display: inline-block;
            *display: inline;
            *zoom: 1;
            font-weight: normal;
            margin: 6px 10px 6px 0;
            vertical-align: middle;
            position: relative;
        }
        input[type="checkbox"],
        input[type="radio"] {
            vertical-align: middle;
            & + .input-ctnr {
                display: none;
            }
            @include max-screen(1000000px) {
                //display: none;
                position: absolute;
                left: 0;
                top: 0;
                width: 0;
                height: 0;
                opacity: 0;
                filter: alpha(opacity=0);
                & + .input-ctnr {
                    display: inline-block;
                    cursor: pointer;
                    -webkit-transition: all 0.1s ease-in;
                    -moz-transition: all 0.1s ease-in;
                    -ms-transition: all 0.1s ease-in;
                    -o-transition: all 0.1s ease-in;
                    transition: all 0.1s ease-in;
                    vertical-align: middle;
                    margin-top: -2px;
                }
            }
        }
    }
    .input-checkbox {
        .input-wrap{
            color: #222;
        }
        
        input[type="checkbox"] {
            & + .input-ctnr {
                width: 14px;
                height: 14px;
                border-width: 1px;
                border-style: solid;
                border-color: #a1aab3;
                -webkit-border-radius: 3px;
                -moz-border-radius: 3px;
                -ms-border-radius: 3px;
                -o-border-radius: 3px;
                border-radius: 3px;
                background-color: #fff;
                margin-right: 5px;
            }
            &:hover + .input-ctnr {
                border-color: #1470cc;
                background-color: #d9ecff;
            }
            &[disabled] + .input-ctnr,
            &.disabled + .input-ctnr {
                border-color: #ced3d9;
                background-color: #edf0f2;
                cursor: not-allowed;
            }
            &:checked + .input-ctnr {
                border-color: #1470cc;
                background-color: #fff;
                position: relative;
                &:after {
                    content: "";
                    display: block;
                    width: 9px;
                    height: 4px;
                    border-width: 0 0 1px 1px;
                    border-style: solid;
                    border-color: #1470cc;
                    position: absolute;
                    left: 2px;
                    top: 3px;
                    -webkit-transform: rotate(-45deg);
                    -moz-transform: rotate(-45deg);
                    -ms-transform: rotate(-45deg);
                    -o-transform: rotate(-45deg);
                    transform: rotate(-45deg);
                    -webkit-transition: all 0.1s ease-in;
                    -moz-transition: all 0.1s ease-in;
                    -ms-transition: all 0.1s ease-in;
                    -o-transition: all 0.1s ease-in;
                    transition: all 0.1s ease-in;
                }
            }
            &[disabled]:checked + .input-ctnr,
            &.disabled:checked + .input-ctnr {
                border-color: #ced3d9;
                background-color: #edf0f2;
                &:after {
                    border-color: #a1aab3;
                }
            }
        }
    }
    .input-radio {
        .input-wrap{
            color: #222;
        }

        input[type="radio"] {
            & + .input-ctnr {
                width: 14px;
                height: 14px;
                border-width: 1px;
                border-style: solid;
                border-color: #a1aab3;
                -webkit-border-radius: 50%;
                -moz-border-radius: 50%;
                -ms-border-radius: 50%;
                -o-border-radius: 50%;
                border-radius: 50%;
                background-color: #fff;
                margin-right: 5px;
            }
            &:hover + .input-ctnr {
                border-color: #1470cc;
                background-color: #d9ecff;
            }
            &[disabled] + .input-ctnr,
            &.disabled + .input-ctnr {
                border-color: #ced3d9;
                background-color: #edf0f2;
                cursor: not-allowed;
            }
            &:checked + .input-ctnr {
                border-color: #1470cc;
                background-color: #fff;
                position: relative;
                &:after {
                    content: "";
                    display: block;
                    width: 6px;
                    height: 6px;
                    -webkit-border-radius: 50%;
                    -moz-border-radius: 50%;
                    -ms-border-radius: 50%;
                    -o-border-radius: 50%;
                    border-radius: 50%;
                    background-color: #1470cc;
                    margin-left: 4px;
                    margin-top: 4px;
                    -webkit-transition: all 0.1s ease-in;
                    -moz-transition: all 0.1s ease-in;
                    -ms-transition: all 0.1s ease-in;
                    -o-transition: all 0.1s ease-in;
                    transition: all 0.1s ease-in;
                }
            }
            &[disabled]:checked + .input-ctnr,
            &.disabled:checked + .input-ctnr {
                border-color: #ced3d9;
                background-color: #edf0f2;
                &:after {
                    background-color: #a1aab3;
                }
            }
        }
    }
    .input-toggle {
        input[type="checkbox"] {
            & + .input-ctnr {
                width: 38px;
                height: 18px;
                border-width: 1px;
                border-style: solid;
                border-color: #cfdae6;
                -webkit-border-radius: 20px;
                -moz-border-radius: 20px;
                -ms-border-radius: 20px;
                -o-border-radius: 20px;
                border-radius: 20px;
                background-color: #fff;
                &:after {
                    content: "";
                    display: block;
                    width: 18px;
                    height: 18px;
                    margin-left: -1px;
                    margin-top: -1px;
                    border-width: 1px;
                    border-style: solid;
                    border-color: #cfdae6;
                    -webkit-border-radius: 50%;
                    -moz-border-radius: 50%;
                    -ms-border-radius: 50%;
                    -o-border-radius: 50%;
                    border-radius: 50%;
                    -webkit-box-shadow: 1px 1px 2px rgba(0, 33, 66, .2);
                    -moz-box-shadow: 1px 1px 2px rgba(0, 33, 66, .2);
                    -ms-box-shadow: 1px 1px 2px rgba(0, 33, 66, .2);
                    -o-box-shadow: 1px 1px 2px rgba(0, 33, 66, .2);
                    box-shadow: 1px 1px 2px rgba(0, 33, 66, .2);
                    background-color: #fff;
                    -webkit-transition: all 0.1s ease-out;
                    -moz-transition: all 0.1s ease-out;
                    -ms-transition: all 0.1s ease-out;
                    -o-transition: all 0.1s ease-out;
                    transition: all 0.1s ease-out;
                }
            }
            &[disabled] + .input-ctnr,
            &.disabled + .input-ctnr {
                border-color: #ced3d9;
                background-color: #edf0f2;
                cursor: not-allowed;
                &:after {
                    border-color: #ced3d9;
                    background-color: #edf0f2;
                    margin-left: -1px;
                    -webkit-box-shadow: none;
                    -moz-box-shadow: none;
                    -ms-box-shadow: none;
                    -o-box-shadow: none;
                    box-shadow: none;
                }
            }
            &:checked + .input-ctnr {
                background-color: #1470cc;
                // box-shadow: 0 0 20px 10px #1470cc inset;
                border-color: #1470cc;
                &:after {
                    border-color: #1470cc;
                    background-color: #fff;
                    margin-left: 19px;
                    -webkit-box-shadow: none;
                    -moz-box-shadow: none;
                    -ms-box-shadow: none;
                    -o-box-shadow: none;
                    box-shadow: none;
                }
            }
            &[disabled]:checked + .input-ctnr,
            &.disabled:checked + .input-ctnr {
                border-color: #ced3d9;
                background-color: #edf0f2;
                &:after {
                    border-color: #ced3d9;
                    background-color: #edf0f2;
                }
            }
        }
    }
    .input-textarea {
        padding-left: 10px;
        padding-right: 10px;
        padding-top: 6px;
        padding-bottom: 6px;
        border-width: 1px;
        border-style: solid;
        border-color: #ced3d9;
        -webkit-border-radius: 3px;
        -moz-border-radius: 3px;
        -ms-border-radius: 3px;
        -o-border-radius: 3px;
        border-radius: 3px;
        resize: vertical;
        outline: 0;
        overflow: auto;
        vertical-align: top;
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        -ms-box-sizing: border-box;
        -o-box-sizing: border-box;
        box-sizing: border-box;
        color: #222;
        &:hover {
            border-color: #a1aab2;
            outline: 0;
        }
        &:focus {
            border-color: #1470cc;
            outline: 0;
        }
    }
    .input-tag {
        @include max-screen(1000000px) {
            .input-wrap {
                margin-top: 0;
            }
        }
        input[type="checkbox"],
        input[type="radio"] {
            & + .input-ctnr {
                border-radius: 3px;
                display: inline-block;
                vertical-align: middle;
                *display: inline;
                *zoom: 1;
            }
            @include max-screen(1000000px) {
                & + .input-ctnr {
                    font-size: 12px;
                    line-height: 18px;
                    padding: 5px 10px;
                    border: 1px solid #ced3d9;
                    color: #888;
                    border-radius: 3px;
                    display: inline-block;
                    vertical-align: middle;
                    *display: inline;
                    *zoom: 1;
                    cursor: pointer;
                    position: relative;
                    -webkit-box-sizing: border-box;
                    -moz-box-sizing: border-box;
                    -ms-box-sizing: border-box;
                    -o-box-sizing: border-box;
                    box-sizing: border-box;
                    margin-top: 0;
                }
                & + .input-ctnr.cut {
                    overflow: hidden;
                    white-space: nowrap;
                    word-wrap: normal;
                    white-space: nowrap;
                    -o-text-overflow: ellipsis;
                    text-overflow: ellipsis;
                    -moz-text-overflow: ellipsis;
                }
                &:hover + .input-ctnr {
                    border: 1px solid #a1aab3;
                    color: #555;
                }
                &:checked + .input-ctnr {
                    border: 1px solid #1470cc;
                    &:after {
                        display: block;
                        position: absolute;
                        right: 2px;
                        bottom: 2px;
                        content: "";
                        width: 2px;
                        height: 4px;
                        border-width: 0 1px 1px 0;
                        border-style: solid;
                        border-color: #fff;
                        -webkit-transform: rotate(32deg);
                        -moz-transform: rotate(32deg);
                        -ms-transform: rotate(32deg);
                        -o-transform: rotate(32deg);
                        transform: rotate(32deg);
                    }
                    &:before {
                        display: block;
                        position: absolute;
                        right: 0;
                        bottom: 0;
                        content: "";
                        width: 0px;
                        height: 0px;
                        border-width: 6px;
                        border-style: solid;
                        border-color: transparent #1470cc #1470cc transparent;
                        -webkit-border-radius: 0 0 2px 0;
                        -moz-border-radius: 0 0 2px 0;
                        -ms-border-radius: 0 0 2px 0;
                        -o-border-radius: 0 0 2px 0;
                        border-radius: 0 0 2px 0;
                    }
                }
                &[disabled] + .input-ctnr {
                    border-color: #ced3d9;
                    color: #b2b2b2;
                    background: #edf0f2;
                    cursor: not-allowed;
                }
                &[disabled]:checked + .input-ctnr,
                &.disabled:checked + .input-ctnr {
                    background: #fff;
                    color: #888;
                    border-color: #8ab8e5;
                    &:before {
                        border-color: transparent #8ab8e5 #8ab8e5 transparent;
                    }
                }
            }
        }

        @include max-screen(1000000px) {
            .input-wrap-small{
                input[type="checkbox"],
                input[type="radio"]{
                    & + .input-ctnr {
                        padding: 0 10px;
                    }
                }
            }
        }
    }
    .textarea-field {
        position: relative;
        display: inline-block;
        *display: inline;
        *zoom: 1;
        .input-textarea {
            -webkit-border-radius: 3px 3px 0 0;
            -moz-border-radius: 3px 3px 0 0;
            -ms-border-radius: 3px 3px 0 0;
            -o-border-radius: 3px 3px 0 0;
            border-radius: 3px 3px 0 0;
            box-sizing: border-box;
            min-height: 88px;
            &:hover {
                border-color: #a1aab2;
                outline: 0;
            }
            &:focus {
                border-color: #1470cc;
                outline: 0;
            }
        }
        .field {
            padding: 8px 10px;
            background: #f5f7fa;
            border-width: 0 1px 1px 1px;
            border-style: solid;
            border-color: #ced3d9;
            -webkit-border-radius: 0 0 3px 3px;
            -moz-border-radius: 0 0 3px 3px;
            -ms-border-radius: 0 0 3px 3px;
            -o-border-radius: 0 0 3px 3px;
            border-radius: 0 0 3px 3px;
        }
        .upload {
            display: inline-block;
            *display: inline;
            *zoom: 1;
            font-size: 12px;
            color: #1470cc;
            overflow: hidden;
            position: relative;
            height: 18px;
            vertical-align: top;
            .micon {
                line-height: 18px;
                vertical-align: top;
            }
        }
        .file {
            position: absolute;
            top: -10px;
            left: -820px;
            border: 0 none;
            display: block;
            font-size: 200px;
            left: -70px \9;
            width: 650px \9;
            height: 210px \9;
            line-height: 230px;
            opacity: 0;
            filter: alpha(opacity=0) !important;
            cursor: pointer;
            *vertical-align: baseline !important;
        }
        .edit {
            float: right;
            position: relative;
        }
        .edit-hd {
            padding: 0 5px;
            .micon {
                vertical-align: top;
                margin-right: 0;
                margin-top: 1px;
            }
        }
        .edit-bd {
            position: absolute;
            right: 0px;
            top: 100%;
            border: 1px solid #ced3d9;
            -webkit-box-shadow: 3px 3px 3px rgba(210, 110, 26, .1);
            -moz-box-shadow: 3px 3px 3px rgba(210, 110, 26, .1);
            -ms-box-shadow: 3px 3px 3px rgba(210, 110, 26, .1);
            -o-box-shadow: 3px 3px 3px rgba(210, 110, 26, .1);
            box-shadow: 3px 3px 3px rgba(210, 110, 26, .1);
            background: #fff;
            z-index: 109;
            -webkit-border-radius: 3px 0 3px 3px;
            -moz-border-radius: 3px 0 3px 3px;
            -ms-border-radius: 3px 0 3px 3px;
            -o-border-radius: 3px 0 3px 3px;
            border-radius: 3px 0 3px 3px;
            padding: 5px 0;
            display: none;
            a {
                display: block;
                width: 180px;
                padding: 7px 10px;
                font-size: 12px;
                line-height: 1.3;
                color: #555;
                text-decoration: none;
                &:hover {
                    background: #e6ecf2;
                    text-decoration: none;
                }
            }
        }
        .edit.selected {
            .edit-hd {
                background: #fff;
                border-width: 1px 1px 0 1px;
                border-style: solid;
                border-color: #ced3d9;
                -webkit-border-radius: 3px 3px 0 0;
                -moz-border-radius: 3px 3px 0 0;
                -ms-border-radius: 3px 3px 0 0;
                -o-border-radius: 3px 3px 0 0;
                border-radius: 3px 3px 0 0;
            }
            .edit-bd {
                display: block;
            }
        }
        .file-list {
            margin-top: 10px;
            padding-top: 1px;
        }
        .file-block {
            border: 1px solid #e6ecf2;
            background: #fff;
            padding: 5px 10px;
            margin-top: -1px;
            position: relative;
        }
        .del {
            float: right;
            color: #000;
            opacity: .3;
            line-height: 1;
            margin-top: 1px;
            &:hover {
                opacity: 1;
            }
            .micon {
                margin-right: 0;
            }
        }
        .preview {
            position: absolute;
            top: 28px;
            left: -1px;
            padding-top: 0;
            z-index: 105;
            width: 80px;
            height: 80px;
            background: #fff;
        }
        .img-cnt {
            width: 80px;
            height: 80px;
            display: table-cell;
            border: 1px solid #e6ecf2;
            background: #fff;
            font-size: 0;
            vertical-align: middle;
            zoom: 1;
            text-align: center;
            cursor: default;
            img {
                max-width: 80px;
                max-height: 80px;
                _width: 80px;
                _height: 80px;
            }
        }
        .file-loading {
            height: 18px;
            overflow: hidden;
            position: relative;
            .loading {
                position: relative;
                top: 6px;
                margin-right: 26px;
            }
            .cancel {
                position: absolute;
                right: 0px;
                top: 0px;
                .micon {
                    vertical-align: top;
                    color: #000;
                    opacity: .3;
                }
                &:hover{
                    .micon {
                        vertical-align: top;
                        opacity: 1;
                    }
                }
            }
        }
    }
    .loading {
        height: 5px;
        overflow: hidden;
        background-color: #e1e3e6;
        .loading-bar {
            float: left;
            width: 0;
            height: 100%;
            font-size: 0;
            background-color: #00b300;
            -webkit-transition: width .1s ease;
            -moz-transition: width .1s ease;
            -ms-transition: width .1s ease;
            -o-transition: width .1s ease;
            transition: width .1s ease;
        }
    }
    .feedback-block {
        clear: left;
        .error {
            margin-top: 5px;
            font-size: 12px;
            color: #e64545;
            display: inline-block;
        }
        .warning {
            margin-top: 5px;
            font-size: 12px;
            color: #ff7733;
            display: inline-block;
        }
    }
    .prompt {
        color: #888888;
        margin-top: 5px;
        margin-bottom: 0;
        font-size: 12px;
    }
    .fields-text {
        padding: 6px 0;
        font-size: 12px;
        line-height: 1.5;
        vertical-align: middle;
        margin: 0 10px 0 0;
        margin-right: 10px;
        display: inline-block;
        *display: inline;
        *zoom: 1;
    }
    .upload-file {
        position: relative;
        margin: 0;
        padding-left: 20px;
        line-height: inherit;
        line-height: 18px;
        height: 18px;
        z-index: 1;
        .ico {
            top: 1px;
        }
        .uploading {
            vertical-align: top;
            margin-top: 1px;
        }
        .ico {
            position: absolute;
            left: 0;
            top: 2px;
            display: block;
            overflow: hidden;
            width: 16px;
            height: 16px;
            text-indent: -999em;
            vertical-align: top;
            background: url("/common/img/icon/ico_files.png") no-repeat;
            background-position: 0px -270px;
        }
        .ico-pdf {
            background-position: 0 0;
        }
        .ico-xls,.ico-xlsx {
            background-position: 0 -54px;
        }
        .ico-doc,.ico-docx {
            background-position: 0 -36px;
        }
        .ico-txt {
            background-position: 0 -18px;
        }
        .ico-jpg {
            background-position: 0 -72px;
        }
        .ico-jpeg {
            background-position: 0 -72px;
        }
        .ico-gif {
            background-position: 0 -252px;
        }
        .ico-bmp {
            background-position: 0 -270px;
        }
        .ico-png {
            background-position: 0 -90px;
        }
        .uploading {
            display: inline-block;
            margin-left: 20px;
            width: 16px;
            height: 16px;
            vertical-align: middle;
            background: url("$${path.common}/img/ico/loading-small.gif") no-repeat;
        }
        .upload-suc {
            display: inline-block;
            margin-left: 20px;
            width: 16px;
            height: 16px;
            vertical-align: middle;
            background: url("$${path.common}/img/ico/ico_suc.png") no-repeat;
        }
        .file-name {
            display: inline-block;
            *display: inline;
            zoom: 1;
            vertical-align: middle;
            margin: 0;
        }
        .action {
            margin-left: 20px;
        }
        .icon-yes2 {
            margin: 0 0 0 20px;
            font-size: 20px;
            color: #57ba56;
        }
    }
    .input-list {
        margin-bottom: 10px;
        .del {
            margin-top: 7px;
            margin-right: 5px;
            color: #222;
            opacity: .3;
            float: left;
            &:hover {
                opacity: 1;
            }
        }
        .feedback-block {
            clear: left;
        }
    }
}
