* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", sans-serif;
}

body {
    height: 100vh;
    overflow: hidden;
    background-color: #636363;
}

.phone-stage {
    position: relative;
    height: 100vh;
    width: min(100vw, calc(100vh * 9 / 16));
    margin: 0 auto;
    overflow: hidden;
    background-color: #B9BAC2;
}

.phone-stage > * {
    width: 100%;
}

.header {
    display: flex;
    justify-content: flex-end;
    padding: 30px 40px;
    align-items: flex-start;
}

.logo {
    width: clamp(80px, 20%, 260px);
}
.logo img {
    display: block;
    width: 100%;
    height: auto;
}

.title-container {
    display: flex;
    align-items: center;
    margin-right: 40px;
}

.content {
    padding-top:20px;
    z-index: 999;
}

.digital-human{
    position: absolute;
    inset: 0;
    z-index: 0;
}

.digital-human .bg-layer,
.digital-human .screen-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.digital-human .bg-layer {
    z-index: 0;
}

.digital-human .bg-layer img,
.digital-human .bg-layer video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.digital-human .screen-player {
    z-index: 1;
}

.digital-human video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}

.chat-container {
    margin-top: 50%;
    opacity: 0.8;
    height: 230px;
    padding: 10px;
    position: relative;
    overflow-y: hidden;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(to top, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, black 80%, transparent 100%);
}

.query-box {
    width: 90%;
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 10px;
}

.query-bubble {
    padding: 4px 13px;
    border-radius: 20px;
    background-color: white;
    color: #333;
    box-shadow: 0 4px 10px rgb(168 202 244 / 30%);
    letter-spacing: 2px;
    opacity: 0.9;
    line-height: 1.4;
}

.query-icon {
    background-color: #4ec2e5;
    width: 22px;
    height: 22px;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 14px;
}

.response-box {
    width: 90%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 10px;
}

.response-bubble {
    background: linear-gradient(to right, #75abe8, #7b9bec, #7c74f1, #8b68f3);
    color: white;
    padding: 8px 13px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    letter-spacing: 2px;
    opacity: 0.9;
    line-height: 1.4;
}

.response-icon {
    background-color: #659ef3;
    width: 22px;
    height: 22px;
    padding: 2px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 14px;
}

.footer {
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    bottom: 40px;
    bottom: calc(env(safe-area-inset-bottom) + 40px);
    left: 0;
    right: 0;
    z-index: 999999;
}

.info-text {
    text-align: right;
}

.footer-left,
.footer-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.footer-left {
    justify-content: flex-start;
}

.footer-right {
    justify-content: flex-end;
}

.qrcode {
    width: 250px;  /* 增大二维码 */
    height: 250px;
    background-color: #f0f0f0;
    border: 2px solid #ddd;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #c9c7c7;
}

.response-text {
    width: 100%;
}

.wakeup-hint {
    margin: 0;
    text-align: left;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.footer .wakeup-hint,
.footer .info-text {
    min-height: 52px;
    font-size: 16px;
    color: #5a5a5a;
    padding: 8px 12px;
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-break: break-word;
}


/* 弹窗样式 */
.start-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000000;
}

.load_7{
    display: inline-block;
    position: relative;
    width: 64px;
    height: 64px;
    margin-right: 10px; /* 增加一点右边距，让文字和动画隔开一点 */
}
.load_7 div{
    position: absolute;
    border: 4px solid #8A2BE2; /* 紫色 */
    opacity: 1;
    border-radius: 50%;
    animation: load_7 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}
.load_7 div:nth-child(2) {
    animation-delay: -0.5s;
}
@keyframes load_7{
    0% {
        top: 28px;
        left: 28px;
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        top: -1px;
        left: -1px;
        width: 58px;
        height: 58px;
        opacity: 0;
    }
}

.dialog-content {
    background-color: white;
    padding: 60px;  /* 增加内边距 */
    border-radius: 20px;
    text-align: center;
    max-width: 70%;
}

.dialog-content h2 {
    color: #3673f3;
    margin-bottom: 40px;
    font-size: 1.2rem;
}

.dialog-content p {
    margin-bottom: 50px;
    color: #666;
    font-size: 1.1rem;
    line-height: 1.3;
}

#startButton {
    background-color: #709dff;
    color: white;
    border: none;
    padding: 20px 50px;
    border-radius: 10px;

    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

#startButton:hover {
    background-color: #49a2fc;
}

/* 添加Canvas样式 */
.video-canvas-container {
    width: 200px;  /* 增大容器 */
    max-width: 720px;  /* 增大最大宽度 */
    position: relative;
    aspect-ratio: 9/16;
    background-color: #a4a4a4;
    overflow: hidden;
    border-radius: 16px;
    display: none;
}

#videoCanvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 768px), (pointer: coarse) {
    body {
        background-color: #000;
    }

    .phone-stage {
        width: 100vw;
        height: 100vh;
    }
}
