body {
    margin: 0;
    height: 100vh;
    /*overflow-y: scroll;*/
    position: relative;
}


.bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('7788.png') center/cover;
    z-index: -1;
    will-change: transform;
}
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.3); /* 半透明遮罩 */
    /*backdrop-filter: blur(4px); !* 毛玻璃效果 *!*/
    z-index: 0; /* 确保在背景图上方 */
}
.content {
    position: relative;
    z-index: 1; /* 确保内容在遮罩上方 */
    color: white;
    /*text-align: center;*/
    /*top: 50%;*/
    /*transform: translateY(-50%);*/
}

.navbar {
    /*background: url('wood-texture.jpg') center/cover;*/
    height: 70px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border-bottom: 3px solid #5c3a21;
}

.nav-item {
    color: #f8f1e5;
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 2px 2px 4px #000;
    padding: 10px 20px;
    border-radius: 5px;
    transition: all 0.3s;
    position: relative;
    background: rgba(92, 58, 33, 0.3);
}

.nav-item:hover {
    background: rgba(92, 58, 33, 0.6);
    transform: translateY(-3px);
}

.nav-item::before, .nav-item::after {
    content: "⚔";
    position: absolute;
    opacity: 0;
    transition: all 0.3s;
}

.nav-item::before {
    left: -10px;
}

.nav-item::after {
    right: -10px;
}

.nav-item:hover::before, .nav-item:hover::after {
    opacity: 1;
}

.logo {
    font-size: 24px;
    color: #d4af37;
    text-shadow: 2px 2px 4px #000;
    letter-spacing: 2px;
}

.medieval-header {

    font-size: 24px;
    color: #d4af37;
    text-shadow: 2px 2px 4px #000;
    letter-spacing: 2px;
    position: relative;
    display: inline-block;
}

.medieval-header::before {
    content: '⚔';
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);

}

.medieval-header::after {
    content: '🛡';
    position: absolute;
    right: -40px;
    top: 50%;
    transform: translateY(-50%);
}
.cute-span {
    display: inline-block; /* 让 span 可以定义宽度和高度，并支持文本居中 */
    width: 120px; /* 固定宽度（可选，根据需要调整）*/
    text-align: center; /* 水平居中 */
    line-height: 30px; /* 垂直居中（根据高度调整）*/

    /* 原有可爱风格样式 */
    font-family: 'Comic Sans MS', '楷体', sans-serif;
    color: #FF69B4;
    background-color: #FFF0F5;
    padding: 5px 10px;
    border: 1px solid #FF1493;
    border-radius: 5px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    text-decoration: underline;
    animation: blink 1s infinite;
}



.scroll-container {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 80px;
    overflow: hidden;
    transition: all 0.5s ease;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path fill="%23d4b483" d="M0,0 L100,0 L100,100 L0,100 Z"/><path fill="none" stroke="%23996633" stroke-width="2" d="M20,20 L80,20 M20,40 L80,40 M20,60 L80,60"/></svg>');
    background-size: cover;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    border-radius: 2px;
    cursor: pointer;
}
.scroll-container:hover {
    width: 300px;
    height: 700px;
    background: #f8f4e6;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
.scroll-content {
    padding: 30px;
    color: #5a3e1f;
    font-family: 'Times New Roman', serif;
    opacity: 0;
    transition: opacity 0.3s ease 0.2s;
}
.scroll-container:hover .scroll-content {
    opacity: 1;
}
.scroll-container::before,
.scroll-container::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 100%;
    background: #d4b483;
    top: 0;
    z-index: -1;
}
.scroll-container::before {
    left: -15px;
    transform: skewY(5deg);
}
.scroll-container::after {
    right: -15px;
    transform: skewY(-5deg);
}

#chatContainer {
    position: fixed;
    left: 20px;
    bottom: 20px;
    width: 600px;
    height: 400px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid #4CAF50;
    border-radius: 10px;
    overflow: hidden;
    font-family: 'Arial', sans-serif;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

#messages {
    height: 340px;
    overflow-y: auto;
    padding: 10px;
    background-color: transparent;
    color: #00ff00;
}

#inputArea {
    display: flex;
    padding: 5px;
    background-color: rgba(0, 0, 0, 0.3);
}

#messageInput {
    flex: 1;
    padding: 5px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid #4CAF50;
    border-radius: 5px;
    color: white;
    outline: none;
}

#sendBtn {
    margin-left: 5px;
    padding: 5px 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#sendBtn:hover {
    background-color: #45a049;
}

/* 自定义滚动条样式 */
#messages::-webkit-scrollbar {
    width: 8px;
}

#messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

#messages::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#messages::-webkit-scrollbar-thumb:hover {
    background: #45a049;
}

.child {
    width: 300px;
    height: 100px;
}

.parent {
    display: flex;
    justify-content: center; /* 水平居中 */


}
:root {
    --move-speed: 0.2s; /* 基础移动速度 */
    --bounce-effect: 15px; /* 弹跳幅度 */
    --shadow-intensity: 0.3; /* 投影强度 */
}

.flip-wrapper {
    transform: scaleX(-1); /* 镜像反转由父级控制 */
}

.puppet-container {

    position: fixed;
    bottom: 10vh;
    width: 180px;
    cursor: pointer;
    transform-origin: bottom center;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, var(--shadow-intensity)));
    transition: filter 0.3s ease;
    image-rendering: crisp-edges;
    will-change: transform, left;
}

/* 复合动画系统 */
.active-animation {
    animation: puppet-walk 1s ease-in-out infinite,
    body-sway 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}



@keyframes puppet-walk {
    0%, 100% {
        transform: translateY(0) rotateZ(-2deg);
    }
    50% {
        transform: translateY(calc(-1 * var(--bounce-effect))) rotateZ(2deg);
    }
}

@keyframes body-sway {
    0%, 100% {
        transform: skewX(0deg);
    }
    50% {
        transform: skewX(4deg);
    }
}

/* 方向控制 */
.reverse-direction {
    transform: scaleX(-1);
    filter: drop-shadow(-2px 4px 6px rgba(0, 0, 0, var(--shadow-intensity)));
}

/* 触摸反馈 */
.touch-feedback {
    animation: tap-effect 0.3s ease-out;
}

@keyframes tap-effect {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* 移动端优化 */
@media (max-width: 768px) {
    .puppet-container {
        width: 120px;
        bottom: 5vh;
    }

    :root {
        --bounce-effect: 50px;
        --move-speed: 0.15s;
    }
}


@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}

.cute-bubble {
    position: fixed;
    background: #ffb6c1;
    color: white;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(255,182,193,0.3);
    font-family: 'Comic Sans MS', cursive;
    z-index: 1000;
    animation: float 2s ease-in-out infinite;
    transition: 0.3s all ease;
    border: 2px solid white;
}

.cute-bubble::after {
    content: '♥';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    color: #ffb6c1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.fade-out {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
}



.custom-modal {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1000;
    text-align: center;
    min-width: 250px;
    animation: fadeIn 0.3s;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-btn {
    background: white;
    color: #6e8efb;
    border: none;
    padding: 8px 15px;
    margin-top: 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
}
.container {
    max-width: 600px;
    margin: 0 auto;
    background-color: rgba(0,0,0,0.7);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
h1 {
    display: flex;
    justify-content: center; /* 水平居中 */
    color: #ffcb05;
    text-shadow: 3px 3px 0 #2a75bb;
    font-size: 2.5em;
}
.silhouette {
    width: 200px;
    height: 200px;
    margin: 20px auto;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 0 10px rgba(255,203,5,0.5));
}
.hint {
    background-color: rgba(42,117,187,0.5);
    padding: 10px;
    border-radius: 10px;
    margin: 15px 0;
    font-size: 1.2em;
}
.options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 25px 0;
}

.score-panel {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    font-size: 1.2em;
}
.type-icon {
    display: inline-block;
    width: 30px;
    height: 30px;
    margin: 0 5px;
    background-size: contain;
}

.icon-display {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    vertical-align: middle;
}
.icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}



.controls {
    margin: 10px auto;
    display: flex;
    justify-content: center;
    gap: 20px;
}
.color-picker, .brush-size {
    display: flex;
    align-items: center;
}
label { margin-right: 5px; }

.medieval-frame {
    margin: 0 auto;
    position: relative;
    width: 840px;
    padding: 20px;
    background: #f5e7c1;
    border: 15px solid transparent;
    border-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M0,0 L100,0 L100,100 L0,100 Z" fill="none" stroke="%238B4513" stroke-width="10"/><path d="M20,20 L80,20 L80,80 L20,80 Z" fill="none" stroke="%23B87333" stroke-width="5"/></svg>') 30 round;
    box-shadow: 0 0 25px rgba(139, 69, 19, 0.6);
}

.medieval-frame::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 3px dashed #B87333;
    pointer-events: none;
}

/* 基础样式 */ /* 省略原有样式以节省篇幅，保留原中世纪风格设定 */

.game-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 30px;
}
.game-card {
    background-color: rgba(255, 255, 255, 0.3); /* 半透明遮罩 */
    border: 1px solid rgba(92, 58, 33, 0.9);
    border-radius: 5px;
    padding: 15px;
    text-align: center;
    transition: transform 0.3s;
}
.game-card:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px #d4af37;
}
.game-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border: 2px solid #5c3a21;
}
.buy-btn {
    background-color: rgba(92, 58, 33, 0.02);
    color: #5c3a21;
    border: 1px solid #5c3a21;;
    padding: 8px 20px;
    cursor: pointer;
    font-family: inherit;
    margin-top: 10px;
}
footer {
    background-color: #3d2b1f;
    text-align: center;
    padding: 20px;
    border-top: 3px solid #5c3a21;
}
/* 新增分页样式 */
.pagination {
    margin: 40px auto;
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 0 30px;
}
.page-btn {
    background: rgba(92, 58, 33, 0.02);
    color: #5c3a21;
    border: 1px solid #5c3a21;
    padding: 8px 15px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Times New Roman', serif;
    font-size: 1.1em;
}
.page-btn:hover:not(.disabled) {
    background: #d4af37;
    color: #3d2b1f;
    box-shadow: 0 0 8px #d4af37;
}
.page-btn.active {
    background: #d4af37;
    color: #3d2b1f;
    font-weight: bold;
    border-color: #3d2b1f;
}
.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}




.banner-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 100%;
    height: 60px;
    overflow: hidden;
    z-index: 9999;
}

.banner {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('ppcv.png') center/cover;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    transform: translateX(-100%);
    animation:
            slideIn 1s forwards,
            slideOut 1s 2s forwards;
}

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

@keyframes slideOut {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}

