:root {
    --jiemu-paper: #f5f3e9;
    --jiemu-card: #fffdf6;
    --jiemu-line: #dfdfd0;
    --jiemu-moss: #456143;
    --jiemu-moss-hover: #354f34;
    --jiemu-on-moss: #fffdf6;
    --jiemu-accent-text: #365532;
    --jiemu-accent-soft: #e6efdf;
    --jiemu-accent-soft-hover: #d6e6cd;
    --jiemu-muted-text: #535f50;
}

html.dark {
    --jiemu-paper: #202821;
    --jiemu-card: #29332a;
    --jiemu-line: #455146;
    --jiemu-moss: #3e5f41;
    --jiemu-moss-hover: #375338;
    --jiemu-accent-text: #c7e6bb;
    --jiemu-accent-soft: #344737;
    --jiemu-accent-soft-hover: #415a43;
    --jiemu-muted-text: #bac7b8;
}

.jiemu-theme {
    background-color: var(--jiemu-paper);
}

.jiemu-mark {
    display: none;
    position: relative;
    margin-inline: auto;
    width: 168px;
    height: 110px;
    pointer-events: none;
}

.jiemu-theme:has(#app .wh-full > .n-card.max-w-md) {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 24px 0 32px;
}

.jiemu-theme:has(#app .wh-full > .n-card.max-w-md) .jiemu-mark {
    display: block;
}

.jiemu-theme:has(#app .wh-full > .n-card.max-w-md) #app {
    height: auto;
}

.jiemu-timber {
    position: absolute;
    inset: 0;
}

.jiemu-timber-left {
    --knock-start: -15px;
    --knock-rebound: -4px;
}

.jiemu-timber-right {
    --knock-start: 15px;
    --knock-rebound: 4px;
}

.jiemu-wood {
    --wood-bark: #92572f;
    --wood-ridge: #bf8250;
    position: absolute;
    top: 44px;
    width: 86px;
    height: 43px;
    box-sizing: border-box;
    border: 2px solid #59351f;
    border-radius: 20px 13px 15px 19px / 50%;
    background: linear-gradient(to bottom,
        var(--wood-ridge) 0 18%, var(--wood-bark) 19% 74%, #704329 75%);
}

.jiemu-wood::before {
    content: '';
    position: absolute;
    z-index: 1;
    inset: -2px auto -2px -2px;
    width: 30px;
    border: 3px solid #674027;
    border-radius: 46% 53% 49% 51% / 48% 54% 47% 52%;
    background: radial-gradient(ellipse at 43% 53%,
        #986036 0 11%, #f8d18d 13% 29%, #bf824b 31% 39%,
        #f8d18d 41% 54%, #ca9358 56% 63%, #f8d18d 65%);
    box-shadow: inset 0 0 0 2px #e4ae6a;
}

.jiemu-wood::after {
    content: '';
    position: absolute;
    inset: 5px 5px 4px 26px;
    background:
        linear-gradient(#704128 0 0) 2px 4px / 39px 2px,
        linear-gradient(#ce925c 0 0) 13px 10px / 31px 2px,
        linear-gradient(#6a3d25 0 0) 1px 16px / 44px 3px,
        linear-gradient(#b57b4e 0 0) 9px 24px / 38px 2px;
    background-repeat: no-repeat;
}

.jiemu-wood-left {
    left: 4px;
    transform: rotate(-24deg);
}

.jiemu-wood-right {
    --wood-bark: #a86b3d;
    --wood-ridge: #cd965f;
    right: 4px;
    transform: rotate(205deg);
}

.jiemu-sprout {
    position: absolute;
    top: 20px;
    left: 124px;
    width: 4px;
    height: 30px;
    border-radius: 3px;
    background: #436738;
    transform: rotate(12deg);
    transform-origin: bottom center;
}

.jiemu-sprout::before,
.jiemu-sprout::after {
    content: '';
    position: absolute;
    box-sizing: border-box;
    border: 1.5px solid #436738;
}

.jiemu-sprout::before {
    top: 9px;
    right: 2px;
    width: 17px;
    height: 10px;
    border-radius: 0 80% 0 80%;
    background: #83ab56;
    transform: rotate(15deg);
}

.jiemu-sprout::after {
    top: 0;
    left: 2px;
    width: 20px;
    height: 11px;
    border-radius: 80% 0 80% 0;
    background: #a2c46b;
    transform: rotate(-18deg);
}

.jiemu-impact,
.jiemu-impact::before,
.jiemu-impact::after {
    position: absolute;
    width: 4px;
    height: 13px;
    border-radius: 4px;
    background: #e7a334;
}

.jiemu-impact {
    opacity: 0;
    top: 11px;
    left: 82px;
}

.jiemu-impact::before,
.jiemu-impact::after {
    content: '';
    top: 7px;
}

.jiemu-impact::before {
    left: -13px;
    transform: rotate(-36deg);
}

.jiemu-impact::after {
    left: 13px;
    transform: rotate(36deg);
}

@media (prefers-reduced-motion: no-preference) {
    .jiemu-mark {
        --jiemu-knock-duration: 760ms;
    }

    .jiemu-theme:has(#app .n-card.max-w-md a[href="#/forgetpassword"]) .jiemu-timber {
        animation: jiemu-knock var(--jiemu-knock-duration) ease-out;
    }

    .jiemu-theme:has(#app .n-card.max-w-md a[href="#/forgetpassword"]) .jiemu-impact {
        animation: jiemu-spark var(--jiemu-knock-duration) ease-out;
    }

    .jiemu-theme:has(#app .n-card.max-w-md a[href="#/forgetpassword"]) .jiemu-sprout {
        animation: jiemu-sprout-sway var(--jiemu-knock-duration) ease-in-out;
    }

    @keyframes jiemu-knock {
        0% { translate: var(--knock-start) -5px; animation-timing-function: ease-in; }
        44% { translate: 0 0; }
        65% { translate: var(--knock-rebound) -2px; }
        100% { translate: 0 0; }
    }

    @keyframes jiemu-spark {
        0%, 41% { opacity: 0; scale: 0.65; }
        44% { opacity: 1; scale: 1; }
        75%, 100% { opacity: 0; scale: 1.15; }
    }

    @keyframes jiemu-sprout-sway {
        0%, 44%, 100% { rotate: 0deg; }
        56% { rotate: -9deg; }
        73% { rotate: 4deg; }
        88% { rotate: -1deg; }
    }
}

.jiemu-theme #app .wh-full:has(> .n-card.max-w-md) {
    box-sizing: border-box;
    height: auto;
    padding-inline: 16px;
}

.jiemu-theme #app .wh-full > .n-card.max-w-md {
    width: 100%;
    border: 1px solid var(--jiemu-line);
    border-radius: 22px;
    background: var(--jiemu-card);
    box-shadow: 0 12px 32px rgb(51 60 43 / 8%);
}

.jiemu-theme[data-theme-color="default"] .n-button--primary-type {
    --n-text-color: var(--jiemu-accent-text) !important;
    --n-text-color-hover: var(--jiemu-accent-text) !important;
    --n-text-color-pressed: var(--jiemu-accent-text) !important;
    --n-text-color-focus: var(--jiemu-accent-text) !important;
}

.jiemu-theme[data-theme-color="default"] .n-button--primary-type:not(.n-button--secondary, .n-button--tertiary, .n-button--quaternary, .n-button--ghost, .n-button--text, .n-button--dashed) {
    --n-color: var(--jiemu-moss) !important;
    --n-color-hover: var(--jiemu-moss-hover) !important;
    --n-color-pressed: var(--jiemu-moss-hover) !important;
    --n-color-focus: var(--jiemu-moss-hover) !important;
    --n-border: 1px solid var(--jiemu-moss) !important;
    --n-border-hover: 1px solid var(--jiemu-moss-hover) !important;
    --n-border-pressed: 1px solid var(--jiemu-moss-hover) !important;
    --n-border-focus: 1px solid var(--jiemu-moss-hover) !important;
    --n-text-color: var(--jiemu-on-moss) !important;
    --n-text-color-hover: var(--jiemu-on-moss) !important;
    --n-text-color-pressed: var(--jiemu-on-moss) !important;
    --n-text-color-focus: var(--jiemu-on-moss) !important;
}

.jiemu-theme[data-theme-color="default"] .n-button--primary-type:is(.n-button--secondary, .n-button--tertiary) {
    --n-color: var(--jiemu-accent-soft) !important;
    --n-color-hover: var(--jiemu-accent-soft-hover) !important;
    --n-color-pressed: var(--jiemu-accent-soft-hover) !important;
    --n-color-focus: var(--jiemu-accent-soft-hover) !important;
}

.jiemu-theme[data-theme-color="default"] :is(.color-primary, .text-primary, .text-primary-400, .text-primary-600) {
    color: var(--jiemu-accent-text);
}

.jiemu-theme :is(.text-gray-400, .text-gray-500, .text-gray-600) {
    color: var(--jiemu-muted-text);
}

.jiemu-check-in:not([hidden]) {
    position: fixed;
    z-index: 20;
    inset: auto 1rem 1rem auto;
    display: grid;
    gap: .35rem;
    justify-items: end;
    color: var(--jiemu-accent-text);
}

.jiemu-check-in button {
    padding: .55rem .9rem;
    border-radius: .6rem;
    background: var(--jiemu-moss);
    color: var(--jiemu-on-moss);
    font-weight: 600;
}

.jiemu-check-in button:disabled,
.jiemu-check-in [role="status"]:not(:empty) {
    background: var(--jiemu-accent-soft);
    color: var(--jiemu-accent-text);
}

.jiemu-check-in [role="status"]:not(:empty) {
    border-radius: .4rem;
    padding: .25rem .5rem;
}
