/* 模拟购物游戏特定样式 */

/* 覆盖通用样式，确保内容垂直排列 */
#gameContent {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
}

.shopping-list {
    background: #fff3e0;
    border: 2px dashed #ff9800;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    min-height: 200px;
}

.shopping-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.shopping-list-item:last-child {
    margin-bottom: 0;
}

.item-number {
    font-weight: bold;
    color: #666;
    min-width: 30px;
}

.item-icon {
    font-size: 1.5rem;
}

.item-name {
    flex: 1;
    font-weight: 500;
}

.item-quantity {
    background: #ff9800;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: bold;
}

/* 购物车和提交按钮容器 */
.cart-and-submit-container {
    margin-top: 2rem;
    width: 100%;
}

/* 用户购物车显示 */
.user-cart-display {
    background: #e8f5e9;
    border: 2px solid #4caf50;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 0;
    min-height: 100px; /* 保持最小高度，避免布局变动 */
}

.cart-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #2e7d32;
}

.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 60px; /* 保持最小高度 */
}

.cart-empty-hint {
    text-align: center;
    color: #999;
    font-size: 0.9rem;
    padding: 1rem;
    font-style: italic;
}

.cart-item-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    font-size: 1rem;
}

.cart-item-number {
    font-weight: bold;
    color: #666;
    min-width: 25px;
}

.cart-item-icon {
    font-size: 1.5rem;
}

.cart-item-name {
    flex: 1;
    font-weight: 500;
}

.cart-item-quantity {
    background: #4caf50;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.9rem;
}

.remove-cart-item-btn {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.remove-cart-item-btn:hover {
    background: #d32f2f;
}

/* 物品清单库 */
.items-library-container {
    margin-top: 0;
    width: 100%;
}

.library-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #333;
}

.items-library {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.library-item {
    background: white;
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.library-item:hover {
    border-color: #1976d2;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.2);
    transform: translateY(-2px);
}

.library-item.selected {
    border-color: #4caf50;
    background: #e8f5e9;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.library-item-icon {
    font-size: 3rem;
}

.library-item-name {
    font-weight: 500;
    font-size: 0.95rem;
    color: #333;
}

.library-item-quantity-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.quantity-btn:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #1976d2;
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-btn.plus {
    color: #4caf50;
}

.quantity-btn.minus {
    color: #f44336;
}

.quantity-display {
    min-width: 24px;
    text-align: center;
    font-weight: bold;
    font-size: 0.9rem;
    color: #333;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .items-library {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .library-item-icon {
        font-size: 2.5rem;
    }

    .library-item-name {
        font-size: 0.85rem;
    }
}
