@import "../../../base/component/animate";
@import "../../../base/theme";

@list-item-box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 5%);
@list-item-box-shadow-lg: 0 0 1rem rgba(0, 0, 0, 5%);

.ub-list-head-tools-placeholder {
    height: 2.0rem;
}

.ub-list-head-tools {
    box-shadow: 0 0 2px #CCC;
    background: var(--color-content-bg);
    height: 2.0rem;
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;

    .item {
        flex: 1;

        &.open {
            .item-drawer-title {
                .icon {
                    transform: rotateZ(180deg);
                }
            }

            .item-drawer-mask {
                display: block !important;
            }
        }

        .item-drawer {
            .item-drawer-title {
                line-height: 2.0rem;
                text-align: center;

                .text, .icon {
                    display: inline-block;
                }

                .icon {
                    color: #CCC;
                    transition: all 0.3s ease-in-out;
                }
            }

            .item-drawer-mask {
                transition: all 0.3s ease-in-out;
                display: none;
                position: absolute;
                top: 2.0rem;
                left: 0;
                right: 0;
                height: calc(100vh - 2.0rem);
                background: rgba(0, 0, 0, 0.5);

                .item-drawer-content {
                    position: relative;
                    padding-bottom: 3.0rem;
                    background: var(--color-content-bg);
                    border-top: 1px solid var(--color-body-line);

                    &.no-foot {
                        padding-bottom: 0;

                        .item-drawer-content-body {
                            max-height: calc(100vh - 2.0rem);
                        }
                    }

                    .item-drawer-content-body {
                        max-height: calc(100vh - 2.0rem - 3.0rem);
                        overflow: auto;
                        background: var(--color-content-bg);
                        padding: var(--size-margin);
                        box-shadow: inset 0 0 10px var(--color-body-line);

                        .item-drawer-content-body-list {
                            .item-drawer-content-body-item {
                                font-size: var(--font-size);
                                text-align: left;
                                line-height: 2rem;
                                padding: 0 1rem;
                                display: flex;

                                &.active {
                                    color: var(--color-primary);

                                    .checked {
                                        visibility: visible;
                                    }
                                }

                                .checked {
                                    font-size: var(--font-size-large);
                                    overflow: hidden;
                                    visibility: hidden;
                                    width: 1.5rem;
                                }

                                .text, .checked {
                                    display: inline-block;
                                    vertical-align: middle;
                                }

                                .text {
                                    border-bottom: 1px solid #F8F8F8;
                                    flex: 1;

                                    &:last-child {
                                        border-bottom: none;
                                    }
                                }
                            }
                        }
                    }

                    .item-drawer-content-foot {
                        display: flex;
                        padding: var(--size-margin);
                        position: absolute;
                        bottom: 0;
                        left: 0;
                        right: 0;
                        background: var(--color-content-bg);
                        border-top: 1px solid var(--color-body-line);

                        .btn {
                            flex: 1;
                            margin: 0 0.5rem;
                        }
                    }
                }
            }

        }
    }
}

.ub-list {
    background: var(--color-content-bg);
    border-radius: var(--size-radius);

    &.no-bg {
        background-color: transparent;

        .head {
            padding: 0.5rem 0;
        }

        .body {
            margin-left: -0.5rem;
            margin-right: -0.5rem;
        }
    }

    .head {
        padding: 0.5rem;

        .more {
            float: right;
            line-height: 1.5rem;
        }

        .title {
            display: inline-block;
            line-height: 1rem;
            font-size: var(--font-size);
        }
    }

    .body {
        margin-top: -0.5rem;
        padding: 0.5rem;
    }
}

.ub-list .body, .ub-list-items {
    mark {
        color: red;
        background: none;
    }

    .item-a {
        border-radius: 0.5rem;
        padding: 0.5rem 0.5rem 0.5rem 3.5rem;
        overflow: hidden;
        margin: 0 0 0.5rem 0;
        box-shadow: @list-item-box-shadow-lg;
        background-color: var(--color-content-bg);

        .icon {
            float: left;
            margin: 0.25rem 0 0 -2.75rem;
            height: 2rem;
            width: 2rem;
            border-radius: 0.15rem;
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;

            img, .img {
                height: 2rem;
                width: 2rem;
                border-radius: 0.15rem;
            }

            img {
                object-fit: contain;
            }
        }

        .title {
            display: block;
            color: var(--color-text);
            font-size: var(--font-size-large);
            line-height: 1.5rem;
            height: 1.5rem;

            &:hover {
                color: #111;
            }
        }

        .summary {
            color: #c4cfdb;
            font-size: var(--font-size);
            height: 1rem;
            line-height: 1rem;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
    }

    .item-b {
        line-height: 2em;
        text-align: center;
        display: block;
        border-radius: 0.25rem;
        margin: 0.25rem 0;
        color: var(--color-primary);
        box-shadow: @list-item-box-shadow-lg;
        color: var(--color-text);

        &:hover {
            background-color: #EEE;
        }
    }

    .item-c {
        line-height: 2em;
        display: block;
        margin: 0.25rem 0;
        color: var(--color-text);
        height: 2em;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;

        &:before {
            content: "▪";
            color: var(--color-primary);
            display: inline-block;
            margin-right: 0.2rem;
        }
    }

    .item-d {
        border-bottom: 0.05rem dashed var(--color-body-line);
        padding: var(--size-margin) 0;

        &:hover {
            .title {
                color: var(--color-primary);
            }
        }

        .title {
            font-size: var(--font-size-large);
            color: var(--color-text);
            line-height: 1.4rem;
            transition: color 0.2s ease-in-out;
        }

        .summary {
            color: var(--color-tertiary);
            font-size: var(--font-size);
            padding: 0.25rem 0 0 0;
        }

        .action {
            display: flex;
            padding-top: 0.25rem;
            color: var(--color-muted);

            a {
                color: var(--color-muted);
            }

            .left {
                flex-grow: 1;
            }

            .right {

            }
        }
    }

    .item-e {
        padding-bottom: 0.5rem;
        border-radius: 0.25rem;
        overflow: hidden;
        border: 1px solid var(--color-body-bg);

        &:hover {
            box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 5%);

            .cover {
                transform: scale(1.05);
            }

            .title {
                color: var(--color-primary);
            }
        }

        .cover {
            display: block;
            overflow: hidden;
            background: no-repeat center;
            background-size: cover;
            border-radius: 0.25rem 0.25rem 0 0;
            transition: transform 0.3s ease-in-out;

            &:after {
                content: '';
                display: block;
                margin-top: 66.666667%;
            }
        }

        .title {
            line-height: 1rem;
            height: 1rem;
            overflow: hidden;
            display: block;
            margin-top: 0.5rem;
            padding: 0 0.5rem;
            color: var(--color-text);
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            transition: all 0.3s ease-in-out;
        }

        .summary {
            margin-top: 0.25rem;
            line-height: 1rem;
            height: 2rem;
            color: #c4cfdb;
            overflow: hidden;
            padding: 0 0.5rem;
        }
    }

    .item-f {
        padding: 0 0 0 4rem;
        margin: 0 0 0.75rem 0;

        .date {
            float: left;
            margin: 0 0 0 -4rem;
            display: block;
            width: 3rem;
            border: 0.05rem solid var(--color-primary);
            border-radius: 0.15rem;
            text-align: center;
            line-height: 1.25rem;

            .day {
                color: #FFF;
                font-size: var(--font-size-large);
                background: var(--color-primary);
            }

            .month {
                color: var(--color-text);
            }
        }

        .title {
            display: block;
            line-height: 1rem;
            height: 1rem;
            overflow: hidden;
        }

        .summary {
            color: #c4cfdb;
            height: 2rem;
            line-height: 1rem;
            overflow: hidden;
        }
    }

    .item-g {
        border-radius: 0.25rem;
        padding: 1rem;
        overflow: hidden;
        margin: 0 0 0.5rem 0;
        text-align: center;
        display: block;
        background-color: var(--color-content-bg);

        &:hover {
            box-shadow: @list-item-box-shadow-lg;
        }

        .icon {

        }

        .title {
            display: block;
            color: var(--color-text);
            margin-top: 0.5rem;
            height: 1rem;
            line-height: 1rem;
            overflow: hidden;

            &:hover {
                color: #111;
            }
        }
    }

    .item-h {
        border: 0.05rem solid #EEE;
        border-radius: 0.15rem;
        padding: 0.5rem 0.5rem 0.5rem 2.5rem;
        overflow: hidden;
        margin: 0 0 0.5rem 0;
        display: block;

        &:last-child {
            margin-bottom: 0;
        }

        &:hover {
            border-color: #CCC;
        }

        .icon {
            float: left;
            margin: 0 0 0 -2rem;

            img {
                height: 1.5rem;
                width: 1.5rem;
                border: none;
            }

            .cover {
                display: block;
                width: 1.5rem;
                height: 1.5rem;
                background-repeat: no-repeat;
                background-position: center;
                background-size: cover;
            }

            i {
                display: block;
                width: 1.5rem;
                height: 1.5rem;
                line-height: 1.5rem;
                text-align: center;
                font-size: var(--font-size-large);
                color: #c4cfdb;
            }
        }

        .title {
            display: block;
            color: var(--color-text);
            font-size: var(--font-size);
            line-height: 1.5rem;
            height: 1.5rem;

            &:hover {
                color: #111;
            }
        }
    }

    .item-i {
        border-radius: 0.25rem;
        padding: 0.5rem 0.5rem 0.5rem 2.5rem;
        overflow: hidden;
        margin: 0 0 0.5rem 0;
        display: block;
        background-color: #FFF;

        &:hover {
            box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 5%);

            .title {
                color: var(--color-primary);
            }
        }

        .right {
            float: right;
            color: var(--color-muted);
            padding-left: 1rem;
        }

        .icon {
            float: left;
            margin: 0.25rem 0 0 -2rem;
            width: 1.5rem;
            border-radius: 0.25rem;

            img {
                height: 1.5rem;
                width: 1.5rem;
                border: none;
            }

            i {
                display: block;
                width: 1.5rem;
                height: 1.5rem;
                line-height: 1.5rem;
                text-align: center;
                font-size: var(--font-size-large);
                color: #c4cfdb;
            }
        }

        .title {
            display: block;
            color: var(--color-text);
            font-size: var(--font-size);
            line-height: 1rem;
            height: 1rem;
            overflow: hidden;
            text-overflow: ellipsis;
            //white-space: nowrap;

            &:hover {
                color: #111;
            }
        }

        .desc {
            color: #c4cfdb;
            font-size: 0.65rem;
            line-height: 1rem;
            height: 1rem;
            overflow: hidden;
            display: block;
            text-overflow: ellipsis;
            //width: 100%;
            //white-space: nowrap;
        }
    }

    .item-j {
        border: 0.05rem solid #EEE;
        border-radius: 0.15rem;
        padding: 0.5rem;
        overflow: hidden;
        margin: 0 0 0.5rem 0;
        display: block;
        color: #c4cfdb;

        &:hover {
            border-color: #CCC;
        }

        .status {
            float: right;
            line-height: 1rem;
            color: #c4cfdb;
        }

        .title {
            display: block;
            color: var(--color-text);
            font-size: var(--font-size);
            line-height: 1rem;
            height: 1rem;

            &:hover {
                color: #111;
            }
        }

        .attr {
            padding: 0.5rem 0 0 0;
            font-size: var(--font-size);

            .line {
                line-height: 0.975rem;
            }
        }
    }

    .item-k {
        padding: 0.5rem 0.5rem 0.5rem 10.5rem;
        overflow: hidden;
        border-radius: 0.25rem;
        background: var(--color-content-bg);

        &.item-k-a {
            padding: 0.5rem 0.5rem 0.5rem 4rem;

            .image {
                width: 3rem;
                margin-left: -3.5rem;
                border-radius: 50%;

                .cover {
                    border-radius: 50%;
                    box-shadow: 0 0 1px #c4cfdb;
                }
            }

            .info {
                padding-top: 0.5rem;
            }
        }

        &.item-k-b {
            padding: 0.25rem 0.25rem 0.25rem 3rem;

            .image {
                width: 2rem;
                height: 2rem;
                margin-left: -2.5rem;

                .cover {
                    box-shadow: 0 0 1px #c4cfdb;
                }
            }

            .title {
                font-size: var(--font-size);
                padding: 0.25rem 0;
                display: block;
                padding: 0.5rem 0;
                line-height: 1rem;
            }

            .right {
                padding: 0 0.25rem;
                height: 2rem;
                display: flex;
                align-items: center;
            }
        }

        &:hover {
            .image {
                .cover {
                    transform: scale(1.05);
                }
            }

            .title {
                color: var(--color-primary);
            }
        }

        .right {
            float: right;
        }

        .image {
            width: 9rem;
            float: left;
            margin-left: -10rem;
            display: block;
            overflow: hidden;
            border-radius: 0.25rem;

            .cover {
                border-radius: 0.25rem;
                transition: transform 0.6s ease-in-out;
            }
        }

        .title {
            font-size: var(--font-size-large);
            color: var(--color-text);
            line-height: 1.2;
            display: block;
            text-overflow: ellipsis;
            overflow: hidden;
            white-space: nowrap;
        }

        .summary {
            color: var(--color-tertiary);
            font-size: var(--font-size);
            padding: 0.5rem 0 0 0;
            height: 3.425rem;
            overflow: hidden;
            line-height: 0.975rem;
            display: block;
            overflow: hidden;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            display: -webkit-box;
        }

        .info {
            color: var(--color-tertiary);
            font-size: var(--font-size);
            padding: 1rem 0 0 0;
            overflow: hidden;
            display: block;

            .left {
                float: left;
            }

            .right {
                float: right;
            }

            a {
                color: var(--color-tertiary);

                &:hover {
                    text-decoration: underline;
                }
            }
        }

    }

    .item-l {
        line-height: 2em;
        display: block;
        position: relative;
        height: 1.5rem;
        overflow: hidden;
        padding-left: 2rem;
        padding-right: 7em;
        box-sizing: content-box;

        .seq {
            position: absolute;
            width: 1rem;
            height: 1rem;
            left: 0;
            top: 0.25em;
            background: #fbe6e6;
            cursor: pointer;
            line-height: 1rem;
            text-align: center;
            color: #D22525;
            display: block;
        }

        .right {
            position: absolute;
            right: 0;
            top: 0;
            color: var(--color-text);
            width: 6em;
            text-align: center;
            background: #F9F9F9;
        }

        .title {
            color: var(--color-primary);
            white-space: nowrap;
            text-overflow: ellipsis;
            display: block;
            height: 1rem;
            overflow: hidden;
        }
    }

    .item-m {
        color: #c4cfdb;
        background-color: #f6f6f6;
        height: 1.5rem;
        line-height: 1.5rem;
        overflow: hidden;
        padding: 0 0.2rem;
        display: -moz-box;
        white-space: nowrap;
        text-overflow: ellipsis;
        display: block;
        margin: 0.10rem -0.15rem;
        border-radius: 3px;

        &:hover {
            background: var(--color-primary);
            color: #FFF;
        }
    }

    .item-n {
        margin-bottom: 1rem;
        transition: all 0.3s ease-in-out;

        &:hover {
            transform: translateY(-0.25rem);
            background: var(--color-content-bg);
            box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.1);
        }

        .image {
            .cover {
                border-radius: 0.1rem;
            }
        }

        .text {
            .cover {
                display: flex;
                align-items: center;
                justify-content: center;
                border-radius: 0.1rem;

                .content {
                    color: #111;
                    text-shadow: 0 0 10px #EEE;
                    font-size: 1rem;
                }
            }
        }
    }

    .item-o {
        background: #FFF;
        margin-bottom: 0.5rem;
        border-radius: 3px;

        &:hover {
            .image {
                .cover {
                    transform: scale(1.1);
                    transition: all 0.6s;
                }
            }
        }

        .image {
            display: block;
            background: #FFF;
            overflow: hidden;
        }

        .title {
            display: block;
            font-size: var(--font-size-large);
            display: block;
            color: var(--color-primary);
            border-top: 0.25rem solid var(--color-primary);
            background: #FFF;
            line-height: 2rem;
            padding: 0 1rem;
            position: relative;

            &:after {
                content: '>';
                display: block;
                transform: scaleX(0.6);
                font-weight: bold;
                position: absolute;
                right: 1rem;
                top: 0;
                height: 2rem;
                font-size: var(--font-size-large);
            }
        }
    }

    .item-p {
        border-radius: 0.25rem;
        margin-bottom: 0.5rem;
        background: #FFF;
        padding: 0 0 1rem 0;
        box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 5%);

        &:hover {
            .image {
                .cover {
                    transform: scale(1.1);
                }
            }
        }

        .image {
            display: block;
            overflow: hidden;
            border-radius: 0.25rem 0.25rem 0 0;

            .cover {
                border-radius: 0.2rem 0.2rem 0 0;
                transition: transform 0.6s;
            }
        }

        .title {
            font-size: var(--font-size);
            text-align: center;
            padding: 0.5rem;
            display: block;
            color: var(--color-text);
            height: 2rem;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;

            &:hover {
                color: var(--color-primary);
            }
        }

        .summary {
            display: block;
            color: #c4cfdb;
            text-align: center;
            height: 1rem;
            line-height: 1rem;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            padding: 0 0.5rem;
            cursor: default;

            &.line2 {
                height: 2rem;
                white-space: normal;
                -webkit-box-orient: vertical;
                -webkit-line-clamp: 2;
                display: -webkit-box;
            }
        }
    }

    .item-video {
        position: relative;
        display: block;
        margin: 0.5rem;
        border-radius: 0.15rem;

        img {
            width: 100%;
        }

        .mask {
            border-radius: 0.15rem;
            position: absolute;
            background: rgba(0, 0, 0, 0.2);
            text-align: center;
            left: 0;
            right: 0;
            bottom: 0;
            top: 0;
            color: #FFF;
            font-size: 3rem;

            .box {
                display: table;
                height: 100%;
                width: 100%;

                i {
                    vertical-align: middle;
                    display: table-cell;
                }
            }
        }
    }

    .item-video-cover {
        background-color: var(--color-content-bg);
        margin: 0 0 0.5rem 0;
        border-radius: var(--size-radius);
        overflow: hidden;
        transition: box-shadow 0.3s;

        &.vertical {
            .cover {
                &:after {
                    margin-top: 151%;
                }
            }
        }

        &:hover {
            box-shadow: @list-item-box-shadow;

            .cover {
                transform: scale(1.05);

                .mask-text {
                    transform: scale(0.95);
                }
            }

            .title {
                color: var(--color-primary);
            }
        }

        .cover {
            display: block;
            overflow: hidden;
            background: no-repeat center;
            background-size: cover;
            border-radius: var(--size-radius) var(--size-radius) 0 0;
            transition: transform 0.3s ease-in-out;
            position: relative;

            &:after {
                content: '';
                display: block;
                margin-top: 66.666667%;
            }

            .mask-text {
                position: absolute;
                bottom: 0;
                left: 0;
                right: 0;
                background: rgba(0, 0, 0, 0.1);
                padding: 0.25rem;
                color: #FFF;
                text-align: center;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                transition: all 0.3s;
            }

        }

        .title {
            line-height: 1rem;
            height: 1.5rem;
            overflow: hidden;
            display: block;
            color: var(--color-text);
            white-space: nowrap;
            text-overflow: ellipsis;
            width: 100%;
            padding: 0.25rem 0.5rem;
        }

        .category {
            padding: 0.25rem 0.5rem;

            .stat {
                float: right;

                a {
                    margin-left: var(--size-margin);
                }
            }

            a {
                color: var(--color-tertiary);

                i {
                    display: inline-block;
                    width: 1em;
                    text-align: center;
                }

                &:hover {
                    color: var(--color-text);
                }
            }
        }
    }

    .item-video-cover-a {
        padding: var(--size-margin);
        margin: 0 0 0.5rem 0;

        &:hover {
            .cover {
                transform: scale(1.07);
                transition: all 0.3s;
            }
        }

        .cover {
            display: block;
            border-radius: var(--size-radius);
            position: relative;

            .time {
                position: absolute;
                display: block;
                bottom: 0.5rem;
                right: 1rem;
                color: #FFF;
                text-shadow: 0 0 2px #CCC;
                font-size: var(--font-size-small);
            }
        }

        .user {
            display: block;
            height: 2.2rem;
            margin-top: -0.5rem;
            margin-left: 1rem;
            position: relative;

            .avatar {
                width: 1.8rem;
                height: 1.8rem;
                display: inline-block;

                .image {
                    width: 1.8rem;
                    height: 1.8rem;
                    border: 0.1rem solid #FFF;
                    border-radius: 50%;

                }
            }

            .name {
                display: inline-block;
                vertical-align: bottom;
                color: #1d1d1d;
            }
        }

        .title {
            line-height: 1rem;
            height: 2rem;
            overflow: hidden;
            display: block;
            color: #1d1d1d;
            text-overflow: ellipsis;
            width: 100%;
        }

        .info {
            font-size: var(--font-size-small);
            color: #c4cfdb;
            padding-top: 0.5rem;
        }
    }
}

@media screen and (max-width: 40rem) {
    .ub-list .body, .ub-list-items {
        .item-k {
            padding: 0.5rem 0.5rem 0.5rem 5rem;

            .title {
                font-size: var(--font-size);
            }

            .image {
                width: 4rem;
                margin-left: -4.5rem;
            }

            .summary {
                font-size: var(--font-size-small);
                padding-top: 0.25rem;
                height: 2rem;
            }
        }
    }
}

@media screen and (max-width: 40rem) {
    .ub-list .body, .ub-list-items {
        .item-video-cover {
            &:hover {
                transform: none;
            }
        }
    }

    .ub-list {
        max-width: 100%;
        overflow: hidden;


        &.no-bg {
            .head {
                padding: 0.5rem;
            }

            .body {

            }
        }
    }
}

.ub-list-pay {

    &.disabled {
        .item {
            &:hover {
                border-color: #EEE;
            }
        }
    }

    &.inlined {
        background: #F8F8F8;
        border-radius: 0.5rem;
        padding: 0.5rem;

        .item {
            display: inline-block;
            min-width: 8rem;
            line-height: 1.5rem;
            cursor: default;
            border: 1px solid var(--color-body-line);
            padding: 0.3rem 0.5rem;
        }
    }

    .item {
        line-height: 2.5rem;
        border: 2px solid #EEE;
        padding: 0 10px;
        border-radius: 0.3rem;
        text-align: left;
        color: var(--color-text);
        display: block;
        margin-bottom: 0.5rem;

        &.active {
            border-color: var(--color-primary);
        }

        &:hover {
            border-color: var(--color-primary);
        }

        .icon {
            width: 1.5rem;
            height: 1.5rem;
            vertical-align: middle;
            margin-right: 0.2rem;
        }
    }
}
