* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
}

.container {
    max-width: 900px;
    width: 100%;
}

.page-title {
    color: white;
    text-align: center;
    margin-top: 30px;
    margin-bottom: 20px;
    font-size: 2rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 角色舞台 */
.pet-stage {
    background: linear-gradient(to bottom, #e3f2fd 0%, #fff9c4 100%);
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    position: relative;
    overflow: hidden;
}

/* 角色容器 */
.pet-character {
    position: relative;
    width: 180px;
    height: 250px;
    transition: transform 0.3s ease;
    cursor: grab;
    user-select: none;
    z-index: 200;
}

/* 额外召唤的角色 */
.additional-character {
    position: fixed;
    z-index: 100;
}

.pet-character:hover {
    transform: scale(1.05);
}

/* 被拖拽时的样式 */
.pet-character.dragging {
    cursor: grabbing !important;
    transform: scale(1.1) !important;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
    transition: none !important;
    z-index: 1000;
}

/* 飘落动画 */
.pet-character.floating {
    animation: float-down 0.8s ease-out;
}

@keyframes float-down {
    0% {
        transform: translateY(-20px) scale(1.05);
    }
    50% {
        transform: translateY(5px) scale(0.98);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

/* 所有部件的基础样式 */
.part {
    position: absolute;
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: all 0.3s ease;
    left: 50%;
    transform: translateX(-50%);
}

/* 呆毛 */
.ahoge {
    top: 0;
    z-index: 10;
    transform-origin: center center;
    left: 50%;
}

.ahoge.wiggle {
    animation: wiggle 0.5s ease-in-out infinite;
}

@keyframes wiggle {
    0%, 100% { transform: translateX(-50%) rotate(-5deg); }
    50% { transform: translateX(-50%) rotate(5deg); }
}

/* 眼镜 */
.glasses {
    top: 0;
    z-index: 7;
    transform-origin: center center;
    left: 50%;
}

/* 脑袋 */
.head {
    top: 0;
    z-index: 5;
}

/* 表情 */
.expression {
    top: 0;
    z-index: 6;
}

/* 身体 */
.body {
    top: 0;
    z-index: 4;
}

/* 手 */
.hands {
    top: 0;
    z-index: 7;
}

/* 腿 */
.legs {
    top: 0;
    z-index: 3;
}

/* 换装层 */
.costume {
    top: 0;
    z-index: 5;
}

/* 手持物层 */
.item {
    top: 0;
    z-index: 8;
}

/* 表情特效层 */
.expression-effect {
    top: 0;
    z-index: 15;
    animation: fadeInOut 2s ease-in-out;
}

/* 环境特效层 */
.environment-effect {
    top: 0;
    z-index: 2;
    width: 150%;
    left: 50%;
    transform: translateX(-50%);
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) scale(0.8); }
    20% { opacity: 1; transform: translateX(-50%) scale(1); }
    80% { opacity: 1; transform: translateX(-50%) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) scale(0.8); }
}

/* 悬浮菜单 */
.floating-menu {
    position: fixed;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
}

.menu-trigger {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.3rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.menu-content {
    position: absolute;
    right: 55px;
    top: 50%;
    transform: translateY(-50%) translateX(100%);
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-height: 70vh;
    overflow-y: auto;
    width: 240px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.floating-menu.active .menu-content {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
    pointer-events: all;
}

.menu-section {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.menu-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.menu-section h3 {
    color: #667eea;
    margin: 0 0 8px 0;
    font-size: 0.8rem;
    font-weight: 600;
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.button-grid button {
    padding: 6px 8px;
    font-size: 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    background: white;
    color: #667eea;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.button-grid button:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 滚动条样式 */
.menu-content::-webkit-scrollbar {
    width: 6px;
}

.menu-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.menu-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.menu-content::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(0);
}

/* 动画类 */
.bounce {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.walk {
    animation: walk 2s linear;
}

@keyframes walk {
    0% { transform: translateX(-100px); }
    100% { transform: translateX(100px); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .page-title {
        font-size: 1.5rem;
        margin-top: 20px;
    }
    
    .pet-character {
        width: 150px;
        height: 210px;
    }
    
    .pet-stage {
        min-height: 300px;
        padding: 20px;
    }
    
    button {
        padding: 8px 15px;
        font-size: 0.85rem;
    }
}