*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    font-size: 100px;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
}

.e-clock {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    width: 13.6rem;
    height: 4rem;
    background-color: #fff;
    border-radius: 0.2rem;
    font-family: Helvetica;
}

.screen {
    --inactive: rgba(0, 0, 0, 0.07);
    --active: rgba(0, 0, 0, 1);

    position: relative;
    top: 0;
    left: 0;
    width: 10.24rem;
    height: 3.5rem;
    background-color: rgba(222, 222, 222, 1);
    border-radius: 0.2rem;
    box-shadow: 0.05rem 0.05rem 0.1rem 0 rgba(0, 0, 0, 0.3) inset, 0 0 0.2rem 0 rgba(0, 0, 0, 0.2) inset;
}

.e-clock:hover .screen {
    background-image: radial-gradient(hsla(24, 91%, 50%, 1), hsla(24, 91%, 80%, 1));
}

.screen.blink {
    animation: alarm 1s step-start infinite;
}

@keyframes alarm {
    0%,
    100% {
        background-image: radial-gradient(hsla(24, 91%, 50%, 1), hsla(24, 91%, 80%, 1));
    }

    50% {
        background-image: radial-gradient(hsla(24, 91%, 60%, 1), hsla(24, 91%, 90%, 1));
    }
}

/* 星期 */
.week {
    position: absolute;
    top: 0.3rem;
    left: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: auto;
    padding: 0 4em;
    font-size: 0.32rem;
    color: var(--inactive);
}

.week .day.active {
    color: var(--active);
    filter: drop-shadow(0.05rem 0.03rem 0.01rem var(--inactive));
}

/* 闹钟图标 */
.icon-clock {
    position: absolute;
    left: 0.35rem;
    bottom: 0.4rem;
    width: 0.8rem;
    height: 0.8rem;
}

.icon-clock .ear {
    position: absolute;
    top: 0.4rem;
    left: 0.4rem;
    width: 0;
    height: 0;
}

.icon-clock .ear::before,
.icon-clock .ear::after {
    content: '';
    position: absolute;
    left: -0.2rem;
    bottom: 0;
    width: 0.4rem;
    height: 0.2rem;
    background-color: var(--inactive);
    border-radius: 0.2rem 0.2rem 0 0;
    transform-origin: bottom center;
}

.icon-clock .ear::before {
    transform: rotate(40deg) translateY(-0.41rem);
}

.icon-clock .ear::after {
    transform: rotate(-40deg) translateY(-0.41rem);
}

.icon-clock .body {
    position: absolute;
    top: 0;
    left: 0;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    border: 0.04rem solid var(--inactive);
}

.icon-clock .body::before {
    content: '';
    position: absolute;
    left: 0.33rem;
    bottom: 0.39rem;
    width: 0.06rem;
    height: 0.24rem;
    background-color: var(--inactive);
}

.icon-clock .body::after {
    content: '';
    position: absolute;
    left: 0.33rem;
    bottom: 0.33rem;
    width: 0.24rem;
    height: 0.06rem;
    background-color: var(--inactive);
}

.icon-clock .leg {
    position: absolute;
    top: 0.4rem;
    left: 0.4rem;
    width: 0;
    height: 0;
}

.icon-clock .leg::before,
.icon-clock .leg::after {
    content: '';
    position: absolute;
    top: 0;
    left: -0.05rem;
    width: 0.1rem;
    height: 0.15rem;
    background-color: var(--inactive);
    transform-origin: top center;
}

.icon-clock .leg::before {
    transform: rotate(36deg) translateY(0.4rem);
}

.icon-clock .leg::after {
    transform: rotate(-36deg) translateY(0.4rem);
}

.icon-clock.active .ear::before,
.icon-clock.active .ear::after,
.icon-clock.active .body::before,
.icon-clock.active .body::after,
.icon-clock.active .leg::before,
.icon-clock.active .leg::after {
    background-color: var(--active);
}

.icon-clock.blink .ear::before,
.icon-clock.blink .ear::after,
.icon-clock.blink .body::before,
.icon-clock.blink .body::after,
.icon-clock.blink .leg::before,
.icon-clock.blink .leg::after {
    animation: blinkBg 1s linear infinite;
}

.icon-clock.active .body {
    border-color: var(--active);
}

.icon-clock.blink .body {
    animation: blinkBorder 1s linear infinite;
}

/* 数字 */
.numbers {
    position: absolute;
    left: 1.4rem;
    bottom: 0.7rem;
    display: flex;
}

.dot {
    position: relative;
    top: 0;
    left: 0;
    margin: 0 0.14rem;
    width: 0.14rem;
    height: 1.4rem;
}

.dot::before,
.dot::after {
    content: '';
    position: absolute;
    width: 0.14rem;
    height: 0.14rem;
    background-color: var(--active);
    filter: drop-shadow(0.05rem 0.03rem 0.01rem var(--inactive));
}

.dot::before {
    top: 0.3rem;
}

.dot::after {
    bottom: 0.3rem;
}

.dot.blink::before,
.dot.blink::after {
    animation: blinkBg 1s linear infinite;
}

.number {
    position: relative;
    top: 0;
    left: 0;
    margin: 0 0.2rem;
    width: 0.7rem;
    height: 1.4rem;
}

.branch {
    --dur: 0.1s;

    position: absolute;
    background-color: var(--inactive);
    filter: drop-shadow(0.05rem 0.03rem 0.01rem rgba(0, 0, 0, 0));
    transition: background-color var(--dur) linear, filter var(--dur) linear;
}

.branch::before,
.branch::after {
    transition: border-color var(--dur) linear;
}

.branch.active {
    background-color: var(--active);
    filter: drop-shadow(0.05rem 0.03rem 0.01rem var(--inactive));
}

.branch.center {
    left: 0.1rem;
    width: 0.5rem;
    height: 0.14rem;
}

.branch.center::before,
.branch.center::after {
    content: '';
    position: absolute;
    top: 0;
    width: 0;
    height: 0;
    border: 0.07rem solid rgba(0, 0, 0, 0);
    border-top-width: 0.07rem;
    border-bottom-width: 0.07rem;
}

.branch.center::before {
    right: 100%;
    border-left-width: 0;
    border-right-color: var(--inactive);
}

.branch.center.active::before {
    border-right-color: var(--active);
}

.branch.center::after {
    left: 100%;
    border-right-width: 0;
    border-left-color: var(--inactive);
}

.branch.center.active::after {
    border-left-color: var(--active);
}

.branch.top.center {
    top: -0.07rem;
}

.branch.middle.center {
    top: 0.63rem;
}

.branch.bottom.center {
    bottom: -0.07rem;
}

.branch.left,
.branch.right {
    width: 0.14rem;
    height: 0.5rem;
}

.branch.left::before,
.branch.right::before,
.branch.left::after,
.branch.right::after {
    content: '';
    position: absolute;
    left: 0;
    width: 0;
    height: 0;
    border: 0.07rem solid rgba(0, 0, 0, 0);
    border-left-width: 0.07rem;
    border-right-width: 0.07rem;
}

.branch.left::before,
.branch.right::before {
    bottom: 100%;
    border-top-width: 0;
    border-bottom-color: var(--inactive);
}

.branch.left.active::before,
.branch.right.active::before {
    border-bottom-color: var(--active);
}

.branch.left::after,
.branch.right::after {
    top: 100%;
    border-bottom-width: 0;
    border-top-color: var(--inactive);
}

.branch.left.active::after,
.branch.right.active::after {
    border-top-color: var(--active);
}

.branch.top {
    top: 0.1rem;
}

.branch.bottom {
    bottom: 0.1rem;
}

.branch.left {
    left: -0.07rem;
}

.branch.right {
    right: -0.07rem;
}

.number.blink .branch {
    animation: blinkBg 1s linear infinite;
}
.number.blink .branch.center::before {
    animation: blinkBorderRight 1s linear infinite;
}
.number.blink .branch.center::after {
    animation: blinkBorderLeft 1s linear infinite;
}
.number.blink .branch.left::before,
.number.blink .branch.right::before {
    animation: blinkBorderBottom 1s linear infinite;
}
.number.blink .branch.left::after,
.number.blink .branch.right::after {
    animation: blinkBorderTop 1s linear infinite;
}

/* AM PM */
.am-pm {
    position: absolute;
    right: 0.35rem;
    bottom: 0.4rem;
    font-size: 0.5rem;
    filter: drop-shadow(0.05rem 0.03rem 0.01rem var(--inactive));
}

/* 按钮 */
.btn-group {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    width: 2rem;
    height: 3.5rem;
}

.btn {
    position: relative;
    top: 0;
    left: 0;
    width: 2rem;
    height: 0.8rem;
    border-radius: 50%;
    background-color: rgba(210, 210, 210, 1);
    box-shadow: 0.01rem 0.01rem 0.02rem rgba(150, 150, 150, 1) inset;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0.1rem;
    left: 0.1rem;
    width: 1.8rem;
    height: 0.6rem;
    border-radius: 50%;
    background-image: linear-gradient(150deg, rgba(250, 250, 250, 1) 25%, rgba(210, 210, 210, 1));
    box-shadow: 0.02rem 0.02rem 0.02rem rgba(0, 0, 0, 0.3);
}

.btn:active::before {
    transform: scale(0.98);
    box-shadow: 0rem 0rem 0.02rem rgba(0, 0, 0, 0.3);
}

.btn:active::after {
    transform: scale(0.96);
    filter: drop-shadow(0 0 0.1rem hsla(24, 91%, 60%, 1));
}

.btn-cmd::after {
    content: '';
    position: absolute;
    top: 0.22rem;
    left: 0.82rem;
    width: 0.36rem;
    height: 0.36rem;
    background-color: rgba(170, 170, 170, 1);
    /* box-shadow: 0.01rem 0.01rem 0.02rem rgba(0, 0, 0, 0.3) inset,
        -0.01rem -0.01rem 0.02rem rgba(250, 250, 250, 0.5) inset; */
}

.btn-cmd:active::after {
    background-color: hsla(24, 91%, 60%, 1);
}

.btn-up::after {
    content: '';
    position: absolute;
    top: 0.18rem;
    left: 0.82rem;
    width: 0;
    height: 0;
    border: 0.18rem solid rgba(0, 0, 0, 0);
    border-top-width: 0;
    border-bottom-width: 0.4rem;
    border-bottom-color: rgba(170, 170, 170, 1);
}

.btn-up:active::after {
    border-bottom-color: hsla(24, 91%, 60%, 1);
}

.btn-down::after {
    content: '';
    position: absolute;
    top: 0.22rem;
    left: 0.82rem;
    width: 0;
    height: 0;
    border: 0.18rem solid rgba(0, 0, 0, 0);
    border-bottom-width: 0;
    border-top-width: 0.4rem;
    border-top-color: rgba(170, 170, 170, 1);
}

.btn-down:active::after {
    border-top-color: hsla(24, 91%, 60%, 1);
}

/* 闪烁 */
@keyframes blinkColor {
    50% {
        color: var(--inactive);
        filter: drop-shadow(0.05rem 0.03rem 0.01rem rgba(0, 0, 0, 0));
    }
}
@keyframes blinkBg {
    50% {
        background-color: var(--inactive);
        filter: drop-shadow(0.05rem 0.03rem 0.01rem rgba(0, 0, 0, 0));
    }
}
@keyframes blinkBorder {
    50% {
        border-color: var(--inactive);
        filter: drop-shadow(0.05rem 0.03rem 0.01rem rgba(0, 0, 0, 0));
    }
}
@keyframes blinkBorderTop {
    50% {
        border-top-color: var(--inactive);
        filter: drop-shadow(0.05rem 0.03rem 0.01rem rgba(0, 0, 0, 0));
    }
}
@keyframes blinkBorderBottom {
    50% {
        border-bottom-color: var(--inactive);
        filter: drop-shadow(0.05rem 0.03rem 0.01rem rgba(0, 0, 0, 0));
    }
}
@keyframes blinkBorderLeft {
    50% {
        border-left-color: var(--inactive);
        filter: drop-shadow(0.05rem 0.03rem 0.01rem rgba(0, 0, 0, 0));
    }
}
@keyframes blinkBorderRight {
    50% {
        border-right-color: var(--inactive);
        filter: drop-shadow(0.05rem 0.03rem 0.01rem rgba(0, 0, 0, 0));
    }
}
