/* 玻璃杯样式 */
.glass {
    width: 120px;
    height: 200px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 0 0 40px 40px;
    background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.3) 100%);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.glass:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* 液体样式 */
.liquid {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80%;
    background: linear-gradient(to bottom, rgba(100, 181, 246, 0.7), rgba(30, 136, 229, 0.9));
    transition: all 0.5s ease;
    border-radius: 0 0 37px 37px;
}

/* 液体混浊效果 */
.liquid.turbid {
    filter: blur(2px);
    opacity: 0.85;
}

/* 液体颜色变化 */
.liquid.salt {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), rgba(245, 245, 245, 0.9));
}

.liquid.sugar {
    background: linear-gradient(to bottom, rgba(255, 248, 220, 0.8), rgba(255, 235, 205, 0.9));
}

.liquid.honey {
    background: linear-gradient(to bottom, rgba(255, 215, 0, 0.8), rgba(218, 165, 32, 0.9));
}

.liquid.alcohol {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.6), rgba(240, 240, 240, 0.8));
}

.liquid.sand {
    background: linear-gradient(to bottom, rgba(100, 181, 246, 0.7) 0%, rgba(100, 181, 246, 0.7) 90%, rgba(210, 180, 140, 0.9) 90%);
}

/* 小球样式 */
.ball {
    position: absolute;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #ee5a24);
    border-radius: 50%;
    left: 50%;
    transform: translateX(-50%);
    bottom: 5px;
    transition: all 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* 小球被取出时的动画 */
@keyframes floatOut {
    0% { transform: translateX(-50%) scale(1); opacity: 1; }
    50% { transform: translateX(-50%) scale(1.1); opacity: 0.9; }
    100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* 小球取出状态的特殊样式 */
.ball.removed {
    background: radial-gradient(circle at 30% 30%, #4ade80, #16a34a);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.6);
    animation: floatOut 1s ease-out forwards;
}

/* 小球成功取出的庆祝效果 */
.ball.success {
    background: radial-gradient(circle at 30% 30%, #4ade80, #16a34a);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.8);
    animation: floatOut 2s infinite ease-in-out;
}

/* 杯子容器 */
.cup-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease;
}

.cup-container:hover {
    transform: scale(1.05);
}

/* 杯子标签 */
.cup-label {
    margin-top: 10px;
    font-weight: bold;
    color: #4a5568;
    text-align: center;
}

/* 道具样式 */
.item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: grab;
    transition: all 0.3s ease;
    padding: 15px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-width: 80px;
}

.item:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

/* 道具图标 */
.item-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 8px;
    background-size: cover;
    background-position: center;
}

.item-icon.sand {
    background: radial-gradient(circle at 30% 30%, #f4a261, #e76f51);
}

.item-icon.salt {
    background: radial-gradient(circle at 30% 30%, #ffffff, #d1d5db);
}

.item-icon.sugar {
    background: radial-gradient(circle at 30% 30%, #fff3b0, #e9c46a);
}

.item-icon.honey {
    background: radial-gradient(circle at 30% 30%, #ffd700, #daa520);
}

.item-icon.alcohol {
    background: radial-gradient(circle at 30% 30%, #ffffff, #e5e7eb);
    border: 2px solid #d1d5db;
}

/* 道具标签 */
.item-label {
    font-size: 14px;
    font-weight: bold;
    color: #4a5568;
    text-align: center;
}

/* 拖拽状态 */
.dragging {
    opacity: 0.5;
    transform: scale(1.1);
}

/* 放置区域高亮 */
.glass.drag-over {
    border-color: #3b82f6;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .glass {
        width: 100px;
        height: 180px;
    }
    
    .item {
        padding: 10px;
        min-width: 60px;
    }
    
    .item-icon {
        width: 50px;
        height: 50px;
    }
    
    h1 {
        font-size: 2xl !important;
    }
    
    .text-lg {
        font-size: base !important;
    }
}

/* iPad 适配 */
@media (min-width: 768px) and (max-width: 1024px) {
    .glass {
        width: 110px;
        height: 190px;
    }
    
    .item {
        padding: 12px;
        min-width: 70px;
    }
    
    .item-icon {
        width: 55px;
        height: 55px;
    }
}

/* 动画效果 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.glass.animate {
    animation: shake 0.5s ease-in-out;
}

/* 液体搅动动画 */
@keyframes stir {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    75% { transform: rotate(-5deg); }
}

.liquid.stirring {
    animation: stir 0.5s ease-in-out;
}

/* 按钮悬停效果增强 */
#undo-btn, #reset-btn {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#undo-btn:hover, #reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* 数值面板样式增强 */
#density-0, #density-1, #density-2 {
    transition: all 0.3s ease;
}

#density-0.changed, #density-1.changed, #density-2.changed {
    color: #f59e0b;
    transform: scale(1.1);
}

/* 杯底样式 */
.glass::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 130px;
    height: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    z-index: -1;
}

/* 小球阴影效果 */
.ball::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, transparent, rgba(0, 0, 0, 0.3));
    opacity: 0.7;
}

/* 液体表面波纹效果 */
.liquid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    border-radius: 50%;
    animation: wave 2s infinite ease-in-out;
}

@keyframes wave {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.5); }
}

/* 道具区标题样式 */
.bg-white h2 {
    color: #2d3748;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* 容器阴影效果 */
.bg-white {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.bg-white:hover {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* 按钮焦点样式 */
#undo-btn:focus, #reset-btn:focus {
    outline: none;
    ring: 2px solid rgba(59, 130, 246, 0.5);
    ring-offset: 2px;
}

/* 杯子容器间距 */
.flex.justify-around > div {
    margin: 0 10px;
}

/* 道具区弹性布局优化 */
.flex.justify-around.flex-wrap {
    gap: 20px;
}

/* 页面滚动平滑 */
html {
    scroll-behavior: smooth;
}

/* 防止文本选择干扰交互 */
.item, .glass {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}