@font-face {
    font-family: 'FontA';
    src: url('../font/HarmonyOS_Sans_SC_Regular.woff2') format('truetype');
}
@font-face {
    font-family: 'FontB';
    src: url('../font/QianTuBiFengShouXieTi-2.woff2') format('truetype');
}
@font-face {
    font-family: 'FontC';
    /* 请将下面的文件名替换为第三个字体的实际文件名 */
    src: url('../font/默陌专辑手写体4.0.woff2') format('truetype');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.content {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(to bottom, #EF6234, #FEB469, #FEAC5A);
    padding: 0.1rem 0.3rem;
}

.head {
    height: 50px;
    width: 100%;
    display: flex;
    align-items: center;
    /* padding: 0 0.4rem;
    margin-top: 0.2rem; */
}

.head > div:first-child {
    width: 40px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.head > div:first-child img {
    width: 0.5rem;
    height: 0.5rem;
    object-fit: contain;
}

.head > div:nth-child(2) {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.head > div:nth-child(2) img {
    height: 1.3rem;
    object-fit: contain;
}

.head > div:last-child {
    width: 40px;
    flex-shrink: 0;
}

.middle{
    width: 100%;
}

.middle-title{
    font-size: 0.5rem;
    color: white;
    margin-top: 0rem;
    margin-bottom: 0rem;
    text-align: center;
}

.section-title {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.2rem;
}

.section-title-left {
    display: flex;
    align-items: center;
}

.section-title-sub {
    font-size: 0.28rem;
    color: rgba(255, 255, 255, 0.8);
}

.color-select {
    width: 100%;
    display: flex;
    gap: 0rem;
    margin-top: 0.3rem;
}

.color-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.color-item img {
    width: 100%;
    height: auto;
    border-radius: 0.2rem;
    display: block;
}

.color-item span {
    font-size: 0.18rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.1rem;
    text-align: center;
    width: 100%;
    word-break: break-all;
    line-height: 1.3;
}


.style-select {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0.3rem;
}

.style-item {
    width: 100%;
    cursor: pointer;
}

.style-item img {
    width: 100%;
    height: auto;
    display: block;
}

.next-btn {
    width: 100%;
    margin-top: 0.5rem;
    padding-bottom: 0.4rem;
    display: flex;
    justify-content: center;
}

.next-btn img {
    width: 50%;
    height: auto;
    display: block;
}

.upload-area {
    width: 100%;
    margin-top: 0.3rem;
    position: relative;
    cursor: pointer;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.upload-bg {
    width: 60%;
    height: auto;
    display: block;
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.photo-frame {
    position: absolute;
    top: 0;
    left: 20%;
    width: 60%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    display: none;
}

.user-photo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    transform-origin: center center;
    touch-action: none;
}

.gesture-layer {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: none;
}

.upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 4;
}

.info-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    font-size: 0.34rem;
    padding: 0.2rem 0;
    margin-top: 0.15rem;
    outline: none;
}

.info-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.generate-btn {
    width: 100%;
    margin-top: 0.6rem;
    padding-bottom: 0.4rem;
    display: flex;
    justify-content: center;
}

.generate-btn img {
    width: 50%;
    height: auto;
    display: block;
}

.section-title-bar {
    display: inline-block;
    width: 3px;
    height: 0.8rem;
    background-color: #fff;
    border-radius: 2px;
    margin-right: 0.4rem;
    flex-shrink: 0;
}

.section-title-text {
    font-size: 0.42rem;
    color: #fff;
    font-weight: 500;
}

.gender-select {
    width: 100%;
    display: flex;
    gap: 0.25rem;
    margin-top: 0.4rem;
}

.gender-item {
    flex: 1;
    aspect-ratio: 3.5 / 1.35;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 0.08rem;
    background-color: #F14D2D;
    border: 0.1px solid transparent;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.gender-item img {
    width: 0.36rem;
    height: 0.36rem;
    margin-bottom: 0.28rem;
    opacity: 0.45;
}

.gender-item span {
    font-size: 0.24rem;
    color: #B3B3B3;
}

.gender-item.active {
    background-color: #F9A854;
    border-color: rgba(255, 255, 255, 0.6);
}

.gender-item.active img {
    opacity: 1;
    filter: brightness(0) invert(1);
}

.gender-item.active span {
    color: #fff;
}

#loadingPage {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, #EF6234, #FEB469, #FEAC5A);
    z-index: 999;
}

.head {
    position: relative;
    z-index: 1000;
}

#resultPage {
    width: 100%;
    padding: 0 0.4rem 0.4rem;
}

.result-tip {
    width: 100%;
    text-align: center;
    color: #fff;
    font-size: 0.32rem;
    padding: 0.25rem 0;
    font-weight: 500;
    margin-top: 0.2rem;
}

.confirm-btn {
    width: 100%;
    margin-top: 0.5rem;
    display: flex;
    justify-content: center;
}

.confirm-btn img {
    width: 50%;
    height: auto;
    display: block;
}

.share-area {
    width: 100%;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.share-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0.1rem;
    margin: 0.34rem 0;
}

.share-hand {
    width: 1rem;
    height: auto;
    margin-top: 0.4rem;
    animation: handScale 1.2s ease-in-out infinite;
}

@keyframes handScale {
    0%, 100% { transform: scale(0.8); }
    50%      { transform: scale(1); }
}

.share-tip {
    color: #fff;
    font-size: 0.32rem;
    margin-top: 0.2rem;
}

.result-container {
    position: relative;
    width: 100%;
    display: block;
    margin: 1rem 0;
}

.result-img {
    width: 100%;
    height: auto;
    display: block;
}

.result-logo {
    width: 3.4rem;
    display: block;
}

.result-slogan {
    width: 4.5rem;
    display: block;
}

.drag-item {
    position: absolute;
    cursor: move;
    padding: 0.3rem;
    border: 1.5px solid transparent;
    border-radius: 0.08rem;
    user-select: none;
    touch-action: none;
    font-size: 0;
}

.drag-item .drag-text {
    display: block;
    line-height: 1;
}

.drag-item .result-logo {
    display: block;
}

.drag-item .drag-close {
    display: none;
    position: absolute;
    top: -0.18rem;
    left: -0.18rem;
    width: 0.46rem;
    height: 0.46rem;
    border-radius: 50%;
    background: #fff;
    color: #333;
    border: none;
    font-size: 0.3rem;
    line-height: 0.46rem;
    text-align: center;
    cursor: pointer;
    padding: 0;
}

.drag-item .drag-text {
    color: #fff;
    font-size: 0.36rem;
    white-space: nowrap;
}

.drag-item.active {
    border-color: #fff;
}

.drag-item.active .drag-close {
    display: block;
}

.loading-spinner {
    width: 1.2rem;
    height: 1.2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.loading-text {
    color: #fff;
    font-size: 0.4rem;
    margin-top: 0.4rem;
}

.toast {
    position: fixed;
    left: 50%;
    top: 40%;
    transform: translate(-50%, -50%);
    max-width: 70%;
    padding: 0.2rem 0.35rem;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 0.3rem;
    line-height: 1.5;
    border-radius: 0.12rem;
    text-align: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
    word-break: break-all;
}
.toast.show {
    opacity: 1;
}