html {
    font-size: 16px;
}

p {
    margin: 0;
    padding: 0;
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

/* 屏幕宽度小于 480px 时： 1rem = 12px */
@media (max-width: 480px) {
    html {
        font-size: 12px;
    }
}

body {
    max-width: 460px;
    width: 100%;
    margin: 0 auto;
}

.main {
    width: 100%;
    min-height: 100vh;
    background-image: url('../img/bg.webp');
    background-size: 100% 100%;
}

.home {
    height: 100vh;
    overflow: hidden;
}

.page-index {
    position: relative;
}
.page-index .index-page {
    width: 100%;
    height: 100vh;
}
.index-logo {
    width: 15%;
    position: absolute;
    left: 5%;
    top: 2%;
}
.page-index .index-img-text {
    width: 100%;
    position: absolute;
    top: 45%;
    right: -35%;
    opacity: 0;
    animation: slideIn 2s ease-out forwards;
}
.page-index .index-img-chat {
    width: 56%;
    position: absolute;
    top: 52%;
    right: 5%;
    animation: fadeIn 3s ease-out forwards;

}
.page-index .next-index {
    position: absolute;
    width: 55%;
    top: 70%;
    right: 5%;
    opacity: 0;
    animation: blink 2s infinite;
    animation-delay: 2s;
}
.index-footer {
    width: 40%;
    position: absolute;
    bottom: 6%;
    right: 5%;
}

@keyframes slideIn {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}
@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}
@keyframes blink {
    0% {
        opacity: .8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: .8;
        transform: scale(1);
    }
}

/* .page-index-bg {
    position: relative;
}

.page-index-bg img:first-child {
    width: 84%;
    margin-left: 8%;
} */

/* .page-index-bg img:last-child {
    width: 26%;
    position: absolute;
    top: 50%;
    left: 37%;
    cursor: pointer;
    animation: fadeOut 5s forwards;
}

.page-index .from {
    width: 26%;
    margin: 15% 38%;
} */

.page-index-two {
    display: none;
}

.page-index-two-active {
    width: 80%;
    padding: 2px 10% 10% 10%;
    display: grid;
    gap: 5px;
    grid-template-columns: repeat(4, 1fr);
}

.represen {
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    /* 初始位置稍微偏下 */
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.represen.show {
    opacity: 1;
    transform: translateY(0);
}

.page-index-two img {
    width: 66%;
    margin-left: 17%;
}

.page-index-two p {
    width: max-content;
    font-size: 14px;
    color: #fff;
    margin: 0 auto;
    padding: 0 5px;
    border-radius: 3px;
    background: linear-gradient(135deg, #cfa15a, #9e7b43);
}

@keyframes fadeOut {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.info {
    width: 90%;
    padding: 5%;
    padding-bottom: 5rem;
}

.info-head {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-head .avatar {
    width: 9rem;
    height: 9rem;
    border-radius: 5px;
    object-fit: cover;
}

.info-head div p {
    color: #fff;
    margin: 0;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 1.8rem;
}

.info-head div img {
    width: 12rem;
}

.info-content {
    color: #fff;
    font-size: 1.2rem;
    line-height: 1.8rem;
    margin-bottom: 2.5rem;
}

.info-content a {
    display: block;
    float: right;
    color: #f5dca9;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
}

.comment-item {
    border: 1px solid #EE761C;
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: #A81F24;
}

.col-2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.question,
.answer {
    margin-bottom: 1rem;
}

.question-info,
.answer-info {
    background: #921E22;
    border-radius: 5px;
    padding: .6rem 1rem;
    min-width: 12rem;
}

.question-info p,
.answer-info p {
    margin: 0;
    line-height: 1.8rem;
}

.question-info p:first-child,
.answer-info p:first-child {
    font-size: 1.2rem;
    color: #fff;
}

.question-time,
.answer-time {
    /* display: flex;
    align-items: center; */
}

.question-time p,
.answer-time p {
    font-weight: bold;
    color: #c07c7f !important;
    font-size: 1.1rem !important;
}

.question-num img {
    width: 2.5rem;
}

.answer-num img {
    width: 3rem;
}

.answer-num {
    position: relative;
}

.add-like {
    position: absolute;
    top: -1.8rem;
    right: -1rem;
    font-size: 1.8rem;
    color: #fff !important;
    font-weight: bold;
    rotate: 10deg;
    opacity: 0;
}

.add-like-active {
    animation: addLikeAnimation 1s ease-in-out;
}

.cancel-like {
    position: absolute;
    top: -1.8rem;
    right: -1rem;
    font-size: 1.8rem;
    color: #fff !important;
    font-weight: bold;
    rotate: 10deg;
    opacity: 0;
}

.cancel-like-active {
    animation: addLikeAnimation 1s ease-in-out;
}


@keyframes addLikeAnimation {
    0% {
        opacity: 0;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-1.8rem);
    }

    100% {
        opacity: 0;
        transform: translateY(0);
    }

}

.question-num p,
.answer-num p {
    margin: 0;
    color: #fff;
    text-align: center;
}

.question-text,
.answer-text {
    margin: 1rem;
    color: #fff;
    font-size: 1rem;
    line-height: 1.5rem;
}

.answer-text,
.answer-num p {
    color: #A11F24;
}

.answer {
    padding: 1rem .5rem;
    background: linear-gradient(45deg, #f4e69e, #c69361, #f5dca9, #f3daba);
}

.back-button-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 10;
}

.back-button {
    background-color: #ff4d4d;
    /* 按钮的背景色 */
    color: white;
    padding: 10px 15px;
    font-size: 16px;
    opacity: .8;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
}

.back-button:hover {
    background-color: #e60000;
    /* 悬浮时的颜色 */
}


/* 悬浮按钮样式 */
.floating-btn {
    position: fixed;
    padding: 0;
    background: unset;
    top: 1rem;
    right: 1rem;
    text-align: right;
    border: none;
    color: white;
    font-size: 3.5rem;
    cursor: pointer;
    z-index: 9997;
    animation: showAndHide 1s ease-in;
}

.floating-btn p {
    font-size: .8rem;
    margin: 0;
    transition: opacity 3s ease, visibility 0s 0.5s, height 0s 0.5s;
}

.floating-btn img {
    display: none;
    background: #fff;
    border-radius: 50%;
    padding: .5rem;
    width: 2rem;
    transition: opacity 3s ease, visibility 0s 0.5s, height 0s 0.5s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* .floating-btn:hover {
background-color: #0056b3;
} */

/* 抽屉样式 */
.drawer {
    position: fixed;
    top: 0;
    right: -26rem;
    /* 初始隐藏在右侧 */
    width: 24rem;
    height: 100%;
    background-color: #a61f24;
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease;
    z-index: 9999;
}

.drawer-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.drawer-content .close {
    width: 2rem;
    position: absolute;
    left: -2rem;
    background-color: #a61f24;
}

.drawer-content h2 {
    margin: 0;
}

.represen-details {
    display: grid;
    gap: .2rem;
    grid-template-columns: repeat(4, 1fr);
    text-align: center;
    height: 75vh;
    overflow: hidden;
    overflow-y: scroll;
}

.represen-details img {
    border-radius: 50%;
    width: 65%;
}

.represen-details p {
    color: #fff;
    margin: 0;
}


/* 遮罩层 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    /* 初始隐藏 */
    z-index: 9997;
}


/* 回到顶部按钮的样式 */
#scrollTopBtn {
    position: fixed;
    top: 78%;
    right: 1rem;
    color: white;
    display: none;
    /* 默认隐藏 */
    cursor: pointer;
    /* opacity: 0; */
    /* transition: opacity 0.3s ease; */
    animation: showAndHide 1s ease-in;
}
#questionBtn {
    width: 3rem;
    height: 3rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    line-height: 3rem;
    text-align: center;
    border-radius: 50%;
    position: fixed;
    top: 92%;
    right: 1rem;
    background: white;
    animation: showAndHide 2s ease-in;
}

#scrollTopBtn img {
    width: 2rem;
    padding: .5rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

#scrollTopBtn.show {
    display: inline-block;
    opacity: 1;
}

@keyframes showAndHide {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.share {
    border-top: 1px dashed #fff;
    padding-top: 1rem;
    display: flex;
    justify-content: end;
    margin: 0;
}

.share li {
    list-style: none;
}

.share li img {
    width: 5rem;
}

/* .whatsapp img {
    width: 3.5rem;
} */

#qrcode,
#privacy-policy {
    position: fixed;
    width: 50%;
    left: 50%;
    top: 20%;
    padding: 1rem;
    background-color: #fff;
    z-index: 9999;
    transform: translateX(-50%);
    display: none;
}

#qrcode img {
    width: 100%;
}

#qrcode p {
    color: #a21f25;
    text-align: center;
    font-weight: bold;
}

.qr-close {
    width: 3rem !important;
    position: absolute;
    top: -3rem;
    right: -3rem;
}

.privacy-policy {
    color: #ececec;
    margin: 0;
    padding-top: 1rem;
    text-align: right;
}

#privacy-policy {
    width: 60%;
}

#privacy-policy p {
    font-weight: bold;
    margin-bottom: 1rem;
}

#privacy-policy a {
    color: #921E22;
    line-height: 1.5rem;
    word-wrap: break-word;
}

#privacy-policy p:last-child {
    background: #ececec;
    padding: .5rem;
    font-weight: 500;
    margin-top: 2rem;
}

.comment-container {
    position: relative;
    width: 100%;
}

.ai-comment {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    padding: 0;
}

.expand-btn {
    display: none;
    background-color: transparent;
    color: #f5dca9;
    font-weight: bold;
    border: none;
    cursor: pointer;
    font-size: 14px;
    position: absolute;
    bottom: 0;
    right: 0;
}

.comment-container.expanded .ai-comment {
    -webkit-line-clamp: none;
    display: block;
}

.comment-container.expanded .expand-btn {
    display: none;
}

.thumbanil-share {
    padding-left: 0;
    border: none;
    color: #fff;
    font-weight: bold;
    align-items: center;
    justify-content: start;
}
.thumbanil-share li img {
    width: 3rem;
}

.comment-form {
    width: 100%;
}
#question-success {
    display: none;
    position: fixed;
    width: 80%;
    font-size: 1.2rem;
    border-radius: 5px;
    top: 50%;
    left: 10%;
    background-color: rgba(0, 0, 0, .6);
    color: #fff;
    text-align: center;
    padding: .5rem;
    animation: toHide 3s ease-in;
}
@keyframes toHide {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}
#commentForm {
    position: fixed;
    width: 70%;
    left: 50%;
    top: 20%;
    padding: 1rem;
    background-color: #fff;
    z-index: 9999;
    transform: translateX(-50%);
    display: none;
}
#commentForm .flex {
    display: flex;
    margin: .5rem 0;
}
.comment-input {
    border: 1px solid #333;
    padding: .5rem;
    border-radius: 5px;
}
#commentForm input, .comment-input {
    width: 75%;
}
#commentForm input:focus, .comment-input:focus {
    outline: none;
}
.comment-dec {
    color: #a21f25;
    font-style: .9rem;
}
#commentForm .submit-btn {
    width: 6rem;
    border: none;
    line-height: 2.2rem;
    border-radius: 3px;
    color: #fff;
    background: #a21f25;
    margin-left: 40%;
    margin-top: 1rem;
}

@media (max-width: 375px) {
    .page-index-two img {
        width: 60%;
    }

    .page-index-two p {
        font-size: 10px;
    }

    .page-index-two-active {
        gap: 2px;
    }
}
