
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Comic Sans MS', cursive, sans-serif;
        }

        :root {
            --primary-color: #9370db;
            --secondary-color: #ff69b4;
            --light-bg: #f9f0ff;
            --container-bg: rgba(255, 255, 255, 0.8);
            --border-radius: 20px;
        }

        body {
            background: linear-gradient(135deg, #e0b0ff, #ffb6c1);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 1rem;
            overflow-x: hidden;
        }

        .container {
            width: 100%;
            max-width: 1200px;
            height: 95vh;
            background: var(--container-bg);
            border-radius: var(--border-radius);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
            display: flex;
            flex-direction: row;
            overflow: hidden;
        }

        .pet-container {
            flex: 6;
            position: relative;
            border-right: 2px dashed var(--secondary-color);
            transition: flex 0.3s ease;
        }

        .pet-container.expanded {
            flex: 6; /* 睡觉时宠物窗口扩大 */
        }

        #pet-canvas {
            width: 100%;
            height: 100%;
            display: block;
        }

        .chat-container {
            flex: 6;
            display: flex;
            flex-direction: column;
            padding: 1rem;
            background: var(--light-bg);
            min-width: 300px;
            transition: flex 0.3s ease;
        }

        .chat-container.contracted {
            flex: 5; /* 睡觉时聊天窗口缩小 */
        }

        .chat-header {
            text-align: center;
            margin-bottom: 1rem;
            color: #8a2be2;
            font-size: clamp(1.2rem, 3vw, 1.5rem);
            text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
        }

        .chat-messages {
            flex: 1;
            overflow-y: auto;
            padding: 1rem;
            background: white;
            border-radius: 15px;
            margin-bottom: 1rem;
            box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
            /* 确保在各种设备上都有最小高度并能正确滚动 */
            min-height: 0;
            max-height: calc(100% - 100px);
        }

        /* 自定义滚动条，增强可见性 */
        .chat-messages::-webkit-scrollbar {
            width: 8px;
        }
        
        .chat-messages::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 10px;
        }
        
        .chat-messages::-webkit-scrollbar-thumb {
            background: #d8bfd8;
            border-radius: 10px;
        }
        
        .chat-messages::-webkit-scrollbar-thumb:hover {
            background: #ba9dc8;
        }

        .message {
            margin-bottom: 0.75rem;
            padding: 0.75rem 1rem;
            border-radius: 15px;
            max-width: 80%;
            word-wrap: break-word;
            font-size: clamp(0.9rem, 2vw, 1rem);
        }

        .user-message {
            background: #d9fdd3;
            margin-left: auto;
            border-bottom-right-radius: 5px;
        }

        .pet-message {
            background: #ffd6e7;
            margin-right: auto;
            border-bottom-left-radius: 5px;
        }

        .sleeping-notice {
            color: #999;
            text-align: center;
            padding: 0.5rem;
            font-style: italic;
            font-size: 0.9rem;
            margin-bottom: 0.75rem;
        }

        .chat-input {
            display: flex;
            gap: 0.75rem;
            margin-top: auto;
        }

        #message-input {
            flex: 1;
            padding: 0.75rem 1rem;
            border: 2px solid #d8bfd8;
            border-radius: 20px;
            outline: none;
            font-size: clamp(0.9rem, 2vw, 1rem);
            transition: all 0.3s ease;
        }

        #message-input:disabled {
            background-color: #f0f0f0;
            cursor: not-allowed;
            border-color: #ccc;
        }

        #send-button {
            padding: 0.75rem 1.25rem;
            background: var(--primary-color);
            color: white;
            border: none;
            border-radius: 20px;
            cursor: pointer;
            transition: background 0.3s;
            display: flex;
            align-items: center;
            gap: 5px;
            white-space: nowrap;
        }

        #send-button:disabled {
            background: #ccc;
            cursor: not-allowed;
        }

        #send-button:hover:not(:disabled) {
            background: #8a2be2;
        }

        .controls {
            position: absolute;
            bottom: 1rem;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 0.75rem;
            z-index: 10;
            flex-wrap: wrap;
            justify-content: center;
            padding: 0.5rem;
            width: 98%;
            max-width: 600px;
        }

        .control-btn {
            padding: 0.6rem 1rem;
            background: #ba55d3;
            color: white;
            border: none;
            border-radius: 15px;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            display: flex;
            align-items: center;
            gap: 5px;
            font-size: clamp(0.8rem, 2vw, 0.9rem);
            flex: 1;
            min-width: fit-content;
            justify-content: center;
        }

        .control-btn:disabled {
            background: #ccc;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        .control-btn:hover:not(:disabled) {
            background: #9932cc;
            transform: translateY(-2px);
        }

        .animal-selector {
            position: absolute;
            top: 1rem;
            right: 1rem;
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
            justify-content: flex-end;
            z-index: 10;
        }

        .animal-btn {
            width: clamp(40px, 10vw, 60px);
            height: clamp(40px, 10vw, 60px);
            border-radius: 50%;
            border: 3px solid white;
            cursor: pointer;
            transition: transform 0.3s, box-shadow 0.3s;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
            background-size: cover;
            background-position: center;
            font-size: clamp(1.2rem, 5vw, 24px);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .animal-btn:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
        }

        .animal-btn.active {
            box-shadow: 0 0 0 3px var(--secondary-color), 0 4px 8px rgba(0, 0, 0, 0.2);
        }

        .loading {
            display: none;
            text-align: center;
            color: var(--primary-color);
            margin-top: 0.75rem;
            font-size: clamp(0.9rem, 2vw, 1rem);
        }

        .thought-bubble {
            position: absolute;
            background: white;
            border-radius: 20px;
            padding: 0.75rem;
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
            max-width: 200px;
            z-index: 5;
            opacity: 0;
            transition: opacity 0.3s;
            pointer-events: none;
            font-size: clamp(0.9rem, 2vw, 1rem);
        }

        .thought-bubble::after {
            content: '';
            position: absolute;
            bottom: -10px;
            left: 30px;
            width: 0;
            height: 0;
            border-left: 10px solid transparent;
            border-right: 10px solid transparent;
            border-top: 10px solid white;
        }

        /* 特效容器 */
        .effect-container {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 4;
        }

        .effect {
            position: absolute;
            opacity: 0;
        }

        

        /* 响应式断点 */
        @media (max-width: 1024px) {
            .control-btn span {
                display: none;
            }
            .control-btn {
                padding: 0.6rem;
                border-radius: 50%;
                flex: none;
            }
        }

        @media (max-width: 768px) {
            .container {
                flex-direction: column;
                height: 95vh;
                max-height: 100vh;
            }
            .pet-container {
                max-height: 40vh;
                flex: none;
                border-right: none;
                border-bottom: 2px dashed var(--secondary-color);
            }
            .pet-container.expanded {
                max-height: 50vh;
            }
            .chat-container {
                flex: 1;
				min-width: 100%;
                min-height: calc(100% - 40vh);
                display: flex;
                flex-direction: column;
            }
            .chat-messages {
                flex: 1;
                min-height: 0;
                max-height: calc(100% - 120px);
                overflow-y: auto;
            }
            .chat-container.contracted {
                min-height: 50vh;
            }
            .animal-selector {
                top: 0.5rem;
                right: 0.5rem;
                gap: 0.5rem;
            }
            .controls {
                bottom: 0.5rem;
                gap: 0.5rem;
            }
        }

        @media (max-width: 480px) {
            body {
                padding: 0.5rem;
                height: 100vh;
                margin: 0;
            }
            .container {
                height: calc(100vh - 1rem);
                max-height: 100vh;
                border-radius: 15px;
                display: flex;
                flex-direction: column;
            }
            .pet-container {
                max-height: 40vh;
            }
            .chat-container {
                flex: 1;
				min-width: 100%;
				min-height: calc(100% - 40vh);
                padding: 0.75rem;
            }
            .chat-messages {
                padding: 0.5rem;
                flex: 1;
                min-height: 0;
                overflow-y: auto;
            }
            .message {
                max-width: 90%;
                padding: 0.6rem 0.8rem;
            }
            .animal-btn {
                width: 35px;
                height: 35px;
                font-size: 1rem;
            }
            .chat-input {
                gap: 0.5rem;
            }
            #message-input {
                padding: 0.6rem 0.8rem;
            }
            #send-button {
                padding: 0.6rem 0.8rem;
            }
        }

        /* 添加动画样式 */
        @keyframes fallingEffect {
            0% { opacity: 1; transform: translate(0, 0) rotate(0deg); }
            100% { opacity: 0; transform: translate(0, 100px) rotate(30deg); }
        }
        
        @keyframes bounceEffect {
            0% { opacity: 1; transform: scale(0.5) translateY(0); }
            50% { transform: scale(1.2) translateY(-30px); }
            100% { opacity: 0; transform: scale(0.5) translateY(0); }
        }
        
        @keyframes floatEffect {
            0% { opacity: 1; transform: translate(0, 0) rotate(0deg); }
            100% { opacity: 0; transform: translate(0, -80px) rotate(30deg); }
        }
        
        @keyframes sleepEffect {
            0% { opacity: 0; transform: translate(0, 20px); }
            20% { opacity: 1; transform: translate(0, 0); }
            80% { opacity: 1; transform: translate(0, 0); }
            100% { opacity: 0; transform: translate(0, -40px); }
        }
        
        @keyframes pulseEffect {
            0% { transform: scale(0.8); opacity: 0.6; }
            50% { transform: scale(1); opacity: 0.8; }
            100% { transform: scale(0.8); opacity: 0.6; }
        }
		/* 自定义提示框样式 */
		.custom-alert {
		    display: none;
		    position: fixed;
		    z-index: 1000;
		    left: 0;
		    top: 0;
		    width: 100%;
		    height: 100%;
		    background-color: rgba(0, 0, 0, 0.5);
		}
		
		.alert-content {
		    background-color: #f9f0ff;
		    margin: 15% auto;
		    padding: 20px;
		    border-radius: 12px;
		    width: 80%;
		    max-width: 350px;
		    text-align: center;
		    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
		    animation: fadeIn 0.3s;
		}
		
		@keyframes fadeIn {
		    from {opacity: 0; transform: translateY(-20px);}
		    to {opacity: 1; transform: translateY(0);}
		}
		
		.alert-content p {
		    margin: 0 0 15px;
		    font-size: 16px;
		    color: #333;
		    line-height: 1.5;
		}
		
		.alert-close {
		    background-color: #f9a5ff;
		    color: white;
		    border: none;
		    padding: 8px 16px;
		    border-radius: 6px;
		    cursor: pointer;
		    font-size: 14px;
		    transition: background-color 0.3s;
		}
		
		.alert-close:hover {
		    background-color: #d08ed8;
		}